-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.common.js
More file actions
38 lines (36 loc) · 899 Bytes
/
webpack.common.js
File metadata and controls
38 lines (36 loc) · 899 Bytes
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
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { resolve } = require("path");
module.exports = {
entry: "./src/index.tsx",
module: {
rules: [
{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
},
{
test: /\.(ts|tsx)$/,
loader: "ts-loader"
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: "style.css"
})
],
resolve: {
alias: {
fonts: resolve(__dirname, "src/assets/fonts"),
theme: resolve(__dirname, "src/theme")
},
extensions: [".js", ".ts", ".tsx"] // NOTE 1
}
};
/*
NOTES
[1] Although we are builing a webpack config that allows us to write
code in TypeScript, we include `.js` here because many of the files
found within node_modules, and upon which this config depends, have
`.js` file extensions.
*/