-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
60 lines (57 loc) · 1.59 KB
/
webpack.config.dev.js
File metadata and controls
60 lines (57 loc) · 1.59 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const env = process.env.WEBPACK_ENV || 'development'
const libraryWebpackConfig = require('./webpack.config.base')(env)
const outputPath = path.resolve('./build')
const config = [
{
devtool: 'eval-source-map',
devServer: {
contentBase: outputPath,
historyApiFallback: true,
stats: {
chunks: false
}
},
entry: {
docs: path.resolve('./docs/lib/app'),
},
node: {
fs: 'empty'
},
output: {
filename: '[name].bundle.js',
path: outputPath,
publicPath: '/',
libraryTarget: 'umd'
},
plugins: [
new CleanWebpackPlugin([outputPath]),
new CopyWebpackPlugin([{ from: './docs/static', to: 'assets' }]),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(env)
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin('[name].style.css'),
new HtmlWebpackPlugin({
template: path.resolve('./docs/index.template.html'),
filename: 'index.html'
}),
],
module: libraryWebpackConfig.module,
resolve: {
extensions: ['.js', '.jsx', '.css', '.scss'],
alias: {
'faast-ui': path.resolve('./src')
},
},
resolveLoader: {
moduleExtensions: ['-loader']
},
}
]
module.exports = config;