-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
72 lines (70 loc) · 1.87 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
66
67
68
69
70
71
72
const webpack = require('webpack')
const path = require('path')
const { AureliaPlugin, ModuleDependenciesPlugin } = require('aurelia-webpack-plugin')
const projectRoot = path.resolve(__dirname, '../')
module.exports = (env = {}) => {
// Variables set by npm scripts in package.json
const isProduction = env.production === true
const platform = env.platform // 'default' by default
return {
entry: {
main: [
'./src/main.ts'
]
},
output: {
path: path.join(__dirname, 'www/dist'),
publicPath: '/dist/',
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.ts'],
modules: ["src", "node_modules"].map(x => path.resolve(x)),
alias :{
'aurelia-framework7-typescript':'aurelia-framework7-typescript/src/index'
}
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader'
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.scss$/, loader: 'style-loader!css-loader!sass-loader'
},
{
test: /\.(png|gif|jpg)$/,
loader: 'url-loader',
options: { limit: '25000' }
},
{
test: /\.(ttf|eot|svg)$/,
loader: 'file-loader'
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?name=fonts/[name].[hash].[ext]&mimetype=application/font-woff' },
]
},
plugins: [
new AureliaPlugin({ includeAll: "src" }),
new webpack.DefinePlugin({
// Allows these constants to be accessed by the aurelia app
PRODUCTION: JSON.stringify(isProduction),
MOBILE_PLATFORM: JSON.stringify(platform)
})
],
devServer: {
port: 3000
}
}
}