-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
64 lines (61 loc) · 2.44 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
var isDevBuild = process.argv.indexOf('--env.prod') < 0;
var path = require('path');
var webpack = require('webpack');
const { AureliaPlugin, ModuleDependenciesPlugin } = require("aurelia-webpack-plugin");
const coreDeps = require("aurelia-core-dependencies");
var bundleOutputDir = './wwwroot/dist';
module.exports = {
resolve: {
extensions: [ '.js', '.ts' ],
modules: ["ClientApp", "node_modules"],
symlinks: false,
},
entry: { "app": "aurelia-bootstrapper" }, // Note: The aurelia-webpack-plugin will add your app's modules to this bundle automatically
output: {
path: path.resolve(bundleOutputDir),
publicPath: '/dist/',
filename: '[name].js'
},
devServer: {
contentBase: "./wwwroot",
},
module: {
rules: [
{ test: /\.less$/i, use: ["style-loader", "css-loader", "less-loader"] },
{ test: /\.ts$/i, include: /ClientApp/, use: ['ts-loader']},
{ test: /\.html$/i, use: 'html-loader' },
{ test: /\.css$/i,
use: [ 'style-loader' ],
issuer: {
test: /\.[tj]s$/i,
}
},
{ test: /\.css$/i, use: [ 'css-loader' ] },
{ test: /\.scss?$/, use: [ 'css-loader', "sass-loader"], include: /ClientApp/ },
{ test: /\.json$/i, use: 'json-loader' },
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' },
]
},
plugins: [
new webpack.DefinePlugin({ IS_DEV_BUILD: JSON.stringify(isDevBuild) }),
new webpack.DllReferencePlugin({
context: __dirname,
manifest: require('./wwwroot/dist/vendor-manifest.json')
}),
new AureliaPlugin({includeAll: "ClientApp" }),
coreDeps,
new ModuleDependenciesPlugin({
"aurelia-grid": ["./grid","./grid.html"],
"grid.html": [ "./aurelia-grid.css"]
}),
].concat(isDevBuild ? [
// Plugins that apply in development builds only
new webpack.SourceMapDevToolPlugin({
filename: '[file].map', // Remove this line if you prefer inline source maps
moduleFilenameTemplate: path.relative(bundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
})
] : [
// Plugins that apply in production builds only
new webpack.optimize.UglifyJsPlugin()
])
};