-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.base.js
More file actions
46 lines (43 loc) · 1.35 KB
/
webpack.config.base.js
File metadata and controls
46 lines (43 loc) · 1.35 KB
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
'use strict'
var webpack = require('webpack')
var path = require('path')
var CopyFilesPlugin = require('copy-webpack-plugin')
var dependencies = require('./package.json').dependencies
module.exports = {
entry: {
app: [path.join(__dirname, 'src', 'index.js')],
vendor: Object.keys(dependencies)
},
output: {
path: path.join(__dirname, 'docs'),
publicPath: '/docs',
filename: 'bundle.js'
},
module: {
noParse: /\.min\.js/,
rules: [
{ test: /\.jsx?$/, exclude: /node_modules/, use: ['babel-loader']},
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, use: 'url?limit=10000&mimetype=application/font-woff' },
{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, use: 'url?limit=10000&mimetype=application/font-woff' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: 'url?limit=10000&mimetype=image/svg+xml' },
{ test: /\.jpg$/, use: 'url-loader?limit=100000' },
{ test: /\.png$/, use: 'url-loader?limit=100000' },
{ test: /\.gif$/, use: 'url-loader?limit=100000' },
{ test: /\.jpg$/, use: 'file-loader' }
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.bundle.js'
}),
new webpack.NoEmitOnErrorsPlugin(),
new CopyFilesPlugin([{
from: './index.html',
to: './index.html'
}, {
from: './src/media',
to: './media'
}])
]
}