-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.common.js
38 lines (36 loc) · 988 Bytes
/
webpack.common.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
const path = require('path');
const BundleTracker = require('webpack-bundle-tracker');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const output_dir = 'static/bundles'
module.exports = {
entry: './raw_static/js/index.js',
output: {
path: path.resolve(output_dir),
filename: "[name]-[hash].js",
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
// query: { plugins: ['transform-runtime'] }
},
{
test: /\.s?css$/,
use: [
{ loader: "style-loader", options: {sourceMap: true} },
{ loader: "css-loader" },
{ loader: "sass-loader", options: {
//includePaths: [path.resolve(__dirname, 'node_modules')],
sourceMap: true
} }
]
}
]
},
plugins: [
new BundleTracker({filename: './webpack-stats.json'}),
new CleanWebpackPlugin([output_dir], {watch: true})
]
};