-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (45 loc) · 1.38 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
const path = require('path');
const WebpackShellPluginNext = require('webpack-shell-plugin-next');
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
module.exports = env => {
const config = {
entry: {
main: path.resolve(__dirname, 'src/index')
},
output: {
path: path.resolve(__dirname, 'dist')
},
externals: {
'@jahia/js-server-core': 'jsServerCoreLibraryBuilder.getLibrary()',
handlebars: 'jsServerCoreLibraryBuilder.getSharedLibrary(\'handlebars\')'
},
plugins: [
new ExtraWatchWebpackPlugin({
files: [
'src/**/*',
'components/**/*',
'views/**/*',
'images/**/*',
'css/**/*',
'javascript/**/*',
'locales/**/*.json',
'resources/**/*.properties',
'definitions.cnd',
'import.xml',
'package.json'
]
})
],
devtool: 'inline-source-map'
};
if (env.deploy) {
config.plugins.push(
new WebpackShellPluginNext({
onAfterDone: {
scripts: ['yarn jahia-deploy pack']
}
})
);
}
return config;
};