-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
66 lines (59 loc) · 2.11 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
60
61
62
63
64
65
var path = require('path');
// Webpack Plugins
var ProvidePlugin = require('webpack/lib/ProvidePlugin');
var DefinePlugin = require('webpack/lib/DefinePlugin');
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
//var ENV = process.env.ENV = process.env.NODE_ENV = 'development';
//const autoprefixer = require('autoprefixer');
module.exports = {
entry: {
'app': './src/app.ts',
'vendor': './src/vendor.ts'
},
output: {
path: "./dist",
filename: "bundle.js"
},
plugins: [
new CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.bundle.js', minChunks: Infinity }),
// static assets
new CopyWebpackPlugin([{ from: 'src/assets', to: 'assets' }]),
// generating html
new HtmlWebpackPlugin({ template: 'src/index.html', inject: false }),
new ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
jquery: 'jquery',
"Tether": 'tether',
"window.Tether": "tether"
})
],
resolve: {
extensions: ['', '.ts', '.js','.json', '.css', '.scss', '.html']
},
module: {
preLoaders: [{ test: /\.ts$/, loader: 'tslint-loader', exclude: [/node_modules/] }],
loaders: [
{ test: /\.ts$/, loader: 'ts-loader' },
// Support for *.json files.
{ test: /\.json$/, loader: 'json-loader' },
// Support for CSS as raw text
{ test: /\.css$/, loader: 'raw-loader' },
// support for .html as raw text
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.scss$/, loader: 'raw-loader!sass-loader' },
{ test: /\.(woff2?|ttf|eot|svg)$/, loader: 'url?limit=10000' },
// Bootstrap 4
{ test: /bootstrap\/dist\/js\/umd\//, loader: 'imports?jQuery=jquery' }
],
noParse: [ path.join(__dirname, 'node_modules', 'angular2', 'bundles') ]
},
//postcss: [autoprefixer],
devServer: {
historyApiFallback: true
},
// we need this due to problems with es6-shim
node: { global: 'window', progress: false, crypto: 'empty', module: false, clearImmediate: false, setImmediate: false }
};