-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.base.js
57 lines (57 loc) · 1.67 KB
/
webpack.base.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
const path = require('path');
const webpack = require('webpack');
const jsDir = process.env.npm_package_config_jsOut;
const AssetsPlugin = require('assets-webpack-plugin');
const pkg = require('./package.json');
module.exports = function () {
return {
context: path.resolve(__dirname, './src/scripts'),
entry: [
'./main.js',
],
output: {
hashDigestLength: 8,
path: path.resolve(__dirname, `./${jsDir}/`),
publicPath: `/${jsDir}/`,
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
formatter: require('eslint/lib/formatters/table'),
failOnError: true,
}
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
esModule: false,
},
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
],
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js',
}
},
plugins: [
new AssetsPlugin({
prettyPrint: true,
filename: 'assets.json',
fullPath: false,
path: path.join(__dirname, 'src', 'templates', 'data'),
}),
]
}
};