-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.demo.js
72 lines (67 loc) · 1.49 KB
/
webpack.config.demo.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 MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: "development",
devtool: 'cheap-module-source-map',
entry: './src/demo/index.ts',
output: {
filename: 'index.js'
},
optimization: {
minimize: false,
},
devServer: {
open: true,
hot: true,
host: "localhost",
port: 9000
},
module: {
rules: [
{
test: /\.(m|j|t)s$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
{
test: /\.handlebars$/,
loader: "handlebars-loader",
options: {
knownHelpersOnly: false,
inlineRequires: '\/assets/icons\/',
},
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'css/index.scss'
}),
new HtmlWebpackPlugin(),
new webpack.DefinePlugin({
PRODUCTION: JSON.stringify(false),
SERVICE_URL: JSON.stringify('http://localhost:7000')
})
],
resolve: {
extensions: ['.ts', '.js', '.json']
}
};