-
Notifications
You must be signed in to change notification settings - Fork 47
/
webpack.pages.config.js
54 lines (53 loc) · 1.57 KB
/
webpack.pages.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
/* eslint-disable prefer-exponentiation-operator */
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
// const WebpackShellPlugin = require('webpack-shell-plugin');
module.exports = (env, argv) => ({
entry: {
'ask-for-login-page': './view/brainbox/src/pages/ask-for-login-page.js',
'index-page': './view/brainbox/src/pages/index-page.js',
'mri-page': './view/brainbox/src/pages/mri-page.js',
'project-page': './view/brainbox/src/pages/project-page.js',
'project-new-page': './view/brainbox/src/pages/project-new-page.js',
'project-settings-page':
'./view/brainbox/src/pages/project-settings-page.js',
'user-page': './view/brainbox/src/pages/user-page.js'
},
devtool: 'eval-source-map',
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({
title: 'Output Management'
})
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'view/brainbox/dist')
},
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { esModule: false, url: false } }
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ['file-loader']
}
]
},
resolve: {
symlinks: false,
alias: {
// for now using the browser build to parse existing inlined components
vue: path.resolve(
`./node_modules/vue/dist/vue.esm-browser${argv.mode === 'production' ? '.prod' : ''
}`
)
}
}
});