-
Notifications
You must be signed in to change notification settings - Fork 86
/
webpack.common.js
40 lines (39 loc) · 1.06 KB
/
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
39
40
const webpack = require('webpack');
const path = require('path');
const AssetsPlugin = require('assets-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: path.resolve(__dirname, 'src/main.js'),
output: {
path: path.resolve(__dirname, 'static/dist'),
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
],
},
plugins: [
new CleanWebpackPlugin({
cleanAfterEveryBuildPatterns: [
'static/dist/*',
'data/chunky-poster/assets.json',
],
}),
new AssetsPlugin({
filename: 'assets.json',
path: path.resolve(__dirname, 'data/chunky-poster'),
prettyPrint: true,
fullPath: false,
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery'
})
],
};