forked from Genaker/reactmagento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·58 lines (52 loc) · 1.39 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const path = require("path");
const CopyWebpackPlugin = require('copy-webpack-plugin');
const LiveReloadPlugin = require('webpack-livereload-plugin');
const liveReloadOptions = {
}
console.log('Dirrectory for compiling:');
console.log(path.join(__dirname, "/view/base/web/js/"));
module.exports = {
entry: "./src/index.js",
output: {
path: path.join(__dirname, "view/base/web/js/"),
filename: "index_bundle.js"
},
/*externals: {
'React': 'React',
'ReactDOM': 'ReactDOM',
'ReactRouter': 'ReactRouter'
},*/
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
},
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
///var/www/html/magento
///var/www/html/magento/../../../../../../../../index_bundle.js
//Deployment path needs to be adjusted
plugins: [
new LiveReloadPlugin(),
new CopyWebpackPlugin([
{
from:path.join(__dirname, "/view/base/web/js/"),
to:'../../../../../../../../pub/static/frontend/{ThemeNamae}/{theme}/en_US/React_React/js/',
force: true
},
{
from:path.join(__dirname, "/view/base/web/js/"),
to:'../../../../../../../../magento/pub/static/frontend/{ThemeName}/{theme}/en_US/React_React/js/',
force: true
}
]),
]
};