-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.admin.config.js
More file actions
50 lines (49 loc) · 1.07 KB
/
Copy pathwebpack.admin.config.js
File metadata and controls
50 lines (49 loc) · 1.07 KB
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
const path = require('path');
const webpack = require('webpack');
module.exports = {
devServer: {
port: 9000
},
devtool: 'cheap-source-map',
entry: {
client: [
'./src/admin/index.jsx'
],
vendor: [
'react', 'react-dom', 'admin-on-rest'
]
},
output: {
path: path.resolve(__dirname, './dist/admin/assets/scripts'),
filename: '[name].min.js',
publicPath: 'http://localhost:9000/assets/scripts/'
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
include: [
path.resolve(__dirname, 'src/admin')
],
options: {
babelrc: false,
presets: [['es2015', {modules: false}], 'react'],
plugins: [
'transform-decorators-legacy',
'transform-class-properties',
'transform-object-rest-spread'
]
}
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor'] // Specify the common bundle's name.
})
]
};