-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.base.js
93 lines (91 loc) · 2.02 KB
/
webpack.base.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
const path = require('path');
const { AureliaPlugin } = require('aurelia-webpack-plugin');
module.exports = {
plugins: [],
module: {
rules: [
{
test: /\.html$/i,
loader: 'html-loader',
include: [
path.resolve('src')
],
},
{
test: /\.scss$/,
use: [
{
loader: require.resolve('css-modules-typescript-loader'),
options: {
mode: process.env.CI ? 'verify' : 'emit'
}
},
{
loader: require.resolve('css-loader'),
options: {
modules: true,
localIdentName: '[name]__[local]',
},
},
{
loader: require.resolve('sass-loader'),
options: {
implementation: require('sass'),
includePaths: [
path.resolve(__dirname, 'src')
]
}
}
],
},
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader'
}
]
}
]
},
resolve: {
extensions: [
'.tsx',
'.ts',
'.js'
],
alias: {
// NOTE(Jake): 2019-01-08
// This needs to be aligned to TypeScript tsconfig "paths".
// Alternatively, awesome-typescript-loader can be installed so this doesn't
// need to be managed in two places.
'cypress-aurelia-unit-test': path.resolve(__dirname, 'lib', 'index.ts'),
'~': path.resolve(__dirname, 'src'),
},
modules: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'lib'),
path.resolve(__dirname, 'node_modules'),
],
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new AureliaPlugin(),
],
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all',
enforce: true
}
}
}
}
};