-
Notifications
You must be signed in to change notification settings - Fork 32
/
webpack.dev.config.js
61 lines (60 loc) · 1.51 KB
/
webpack.dev.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
const path = require('path');
module.exports = {
entry: path.resolve('examples/index.ts'),
mode: 'development',
output: {
path: path.resolve('examples/public'),
filename: 'bundle.js',
library: 'typewriter',
},
module: {
rules: [
{
test: /\.js$/,
resolve: { fullySpecified: false }
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: [{
loader: 'ts-loader',
options: { onlyCompileBundledFiles: true }
}],
},
{
test: /\.svelte$/,
use: {
loader: 'svelte-loader',
options: {
onwarn: (warning, handleWarning) => {
if (warning.code.startsWith('a11y-') || warning.code.includes('noreferrer')) return;
if (warning.code === 'a11y-no-onchange' || warning.code === 'a11y-label-has-associated-control') return;
// handleWarning(warning);
},
immutable: true,
preprocess: require('svelte-preprocess')({}),
},
},
},
{
test: /\.txt$/,
use: 'raw-loader'
}
],
},
devtool: 'source-map',
resolve: {
conditionNames: ['svelte'],
extensions: [ '.ts', '.tsx', '.js' ],
alias: {
'typewriter-editor$': path.resolve('src/index.ts'),
'typewriter-editor/lib': path.resolve('src'),
},
},
devServer: {
static: { directory: path.resolve('examples/public') },
port: 9000,
host: '0.0.0.0',
historyApiFallback: true,
},
};