forked from nomcopter/react-mosaic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.base.js
43 lines (40 loc) · 1.13 KB
/
webpack.config.base.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
const _ = require('lodash');
const webpack = require('webpack');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VENDOR_LIBS = _.keys(require('./package.json').dependencies);
let config = {
entry: {
app: './dev/index.ts',
vendor: VENDOR_LIBS
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'docs')
},
devtool: '#source-map',
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.json', '.ts', '.js', '.tsx']
},
module: {
loaders: [
{ test: /\.html$/, loader: 'html' },
{ test: /\.tsx?$/, loader: 'ts' },
{ test: /node_modules.*\.js$/, loader: 'source-map-loader' },
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.eot$/, loader: 'file' },
{ test: /\.less/, loader: 'style!css?sourceMap!less?sourceMap' }
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity
}),
new HtmlWebpackPlugin({
template: './dev/index-template.html',
filename: 'index.html'
})
]
};
module.exports = config;