-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.babel.js
62 lines (59 loc) · 1.59 KB
/
webpack.dev.babel.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
59
60
61
62
import path from 'path';
import webpack from 'webpack';
import merge from 'webpack-merge';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import pkgInfo from 'pkginfo';
import common from './webpack.common.babel';
pkgInfo(module);
export default merge(common, {
devtool: 'inline-source-map',
mode: 'development',
output: {
filename: `scripts/${module.exports.name}/js/[name].js`,
path: path.resolve(__dirname, 'dist/web_root'),
publicPath: 'http://localhost:8081',
},
module: {
rules: [
{
test: /\.scss$/,
use: [
'css-hot-loader',
{
loader: MiniCssExtractPlugin.loader,
options: {
includePaths: [
path.resolve(__dirname, 'node_modules/')
]
}
},
'css-loader',
'sass-loader'
]
},
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'scripts/student-profile/css/[name].css'
}),
new webpack.NamedModulesPlugin()
],
serve: {
dev: {
headers: {
'Access-Control-Allow-Origin': '*'
}
},
host: '0.0.0.0',
port: '8081',
clipboard: false,
hot: {
port: '8500',
host: {
client: 'localhost',
server: '0.0.0.0'
}
}
}
});