-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.client.config.js
61 lines (60 loc) · 1.71 KB
/
webpack.client.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
60
61
var webpack = require('webpack');
var path = require('path')
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
entry: {
qdb: './src/app'
},
output: {
path: path.resolve('./dist/'),
filename: '[name].bundle.js'
},
cache: true,
devtool: 'inline-cheap-module-source-map',
resolve: {
extensions: ['.ts', '.js', '.tsx', '.jsx'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: ['babel-loader', 'ts-loader'],
exclude: /node_modules/
},
{
test: /\.tsx?$/,
exclude: /api.ts/, // API is auto-generated by swagger-codegen
loader: 'tslint-loader',
options: {
typeCheck: true,
emitErrors: true,
failOnHint: true
},
enforce: 'pre'
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
"css-loader",
"postcss-loader",
"sass-loader"
]
})
}
],
},
plugins: [
// new webpack.optimize.UglifyJsPlugin([]),
// new webpack.optimize.DedupePlugin()
new ExtractTextPlugin({
filename: 'qdb.bundle.css',
allChunks: true
}),
new CopyWebpackPlugin([
{ from: "static" } // Copy contents of /static to /dist/client/
])
],
}