-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.common.config.js
76 lines (65 loc) · 2.32 KB
/
webpack.common.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
66
67
68
69
70
71
72
73
74
75
76
'use strict';
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = function () {
return {
debug: false,
profile: true,
bail: false,
entry: {
polyfills: [
path.resolve(__dirname, 'node_modules/es6-shim/es6-shim.min.js'),
path.resolve(__dirname, 'node_modules/es6-promise/dist/es6-promise.min.js'),
path.resolve(__dirname, 'node_modules/reflect-metadata/Reflect.js'),
path.resolve(__dirname, 'node_modules/zone.js/dist/zone.min.js'),
path.resolve(__dirname, 'node_modules/zone.js/dist/long-stack-trace-zone.min.js')
],
libs: [
path.resolve(__dirname, 'node_modules/aframe/dist/aframe-v0.3.0.min.js'),
path.resolve(__dirname, 'node_modules/aframe-animation-component/dist/aframe-animation-component.min.js'),
path.resolve(__dirname, 'node_modules/aframe-bmfont-text-component/dist/aframe-bmfont-text-component.min.js')
]
},
output: {
filename: '[name].bundle.js'
},
module: {
loaders: [
{
test: /\.ts$/,
loaders: ['angular2-template-loader', 'awesome-typescript-loader'],
exclude: [/\.(spec|e2e)\.ts$/]
},
{
test: /\.(html)$/,
loader: 'raw-loader',
exclude: ['app/index.html']
},
{
test: /\.scss$/,
exclude: /node_modules/,
loaders: ['raw-loader', 'sass-loader']
}
]
},
resolve: {
root: [path.resolve(__dirname, 'app')],
extensions: ['', '.ts', '.js']
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new CopyWebpackPlugin([
{ from: 'node_modules/videogular2/fonts', to: 'fonts' },
{ from: 'assets', to: 'assets' }
])
],
devtool: false,
devServer: {
compress: true
}
};
};