-
Notifications
You must be signed in to change notification settings - Fork 22
/
webpack.config.js
58 lines (54 loc) · 1.48 KB
/
webpack.config.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
let path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = env => {
let buildDir = 'app/build/';
let entryScript = './src/js/mainScript.js';
let outputFilename = 'asterics-grid.bundle.js';
let mode = env && env.production ? 'production' : 'development';
let scssRule = {
test: /\.(s*)css$/,
use: ['style-loader', 'css-loader']
};
let vueRule = {
test: /\.vue$/,
loader: 'vue-loader'
};
let publicPath = env.production ? buildDir : `/${buildDir}`
return {
mode: mode,
entry: entryScript,
plugins: [new VueLoaderPlugin()],
output: {
path: path.resolve(__dirname, buildDir),
publicPath: publicPath,
filename: outputFilename,
chunkFilename: '[name].bundle.js',
},
resolve: {
alias: {
vue: 'vue/dist/vue.esm.js',
predictionary: 'predictionary/src/index.mjs'
}
},
devServer: {
static: {
directory: path.resolve(__dirname),
watch: true
},
host: '0.0.0.0',
port: 9095,
open: false,
hot: true,
client: {
overlay: true
}
},
externals: {
jquery: '$',
PouchDB: 'PouchDB'
},
module: {
rules: [scssRule, vueRule]
}
};
};