-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
41 lines (31 loc) · 899 Bytes
/
webpack.common.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
const header = require("./settings/headers.js");
// Les imports relatifs à webpack
const path = header.path;
// Les règle dont va se servir
const modules = require("./settings/modules.js");
// if we use yarn
// const yarnModules = path.resolve(__dirname, '')
module.exports = {
entry: "./src/index.tsx",
output: {
filename: "[name].bundle.js",
path: header.path.resolve(__dirname, "dist"),
clean: true
},
module: modules,
plugins: [
new header.plugins.HtmlWebpackPlugin({
title: "Webpack Template Youhou",
template: "src/page/template.ejs"
}),
new header.plugins.MiniCssExtractPlugin()
],
resolve: {
extensions: [".tsx", ".ts", ".js", ".jsx"],
alias:{
style: path.resolve(__dirname, "src/styles"),
assets: path.resolve(__dirname, "src/static"),
fonts: path.resolve(__dirname, "src/static/fonts")
}
}
};