-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
59 lines (56 loc) · 1.26 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
59
// Until babel-loader 7 is released
process.noDeprecation = true
var nodeExternals = require('webpack-node-externals')
var ProgressBarPlugin = require('progress-bar-webpack-plugin')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var resolve = require('path').resolve
var r = function (p) { return resolve(__dirname, p) }
module.exports = {
target: 'node',
node: {
__dirname: false,
__filename: false
},
devtool: 'source-map',
entry: r('./lib/nuxt.js'),
output: {
path: r('./dist'),
filename: 'nuxt.js',
libraryTarget: 'commonjs2'
},
externals: [
nodeExternals()
],
module: {
rules: [
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
plugins: [
'transform-async-to-generator',
'array-includes',
'transform-runtime'
],
presets: [
['es2015', { modules: false }],
'stage-2'
],
cacheDirectory: true
}
}
]
},
plugins: [
new CopyWebpackPlugin([
{ from: 'lib/app', to: 'app' },
{ from: 'lib/views', to: 'views' }
]),
new ProgressBarPlugin()
]
}