forked from taalhavras/ucal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
75 lines (74 loc) · 1.83 KB
/
webpack.prod.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
const path = require("path");
// const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const MomentLocalesPlugin = require("moment-locales-webpack-plugin");
module.exports = {
mode: "production",
entry: {
app: "./interface/src/index.js",
},
module: {
rules: [
{
test: /\.(j|t)sx?$/,
use: {
loader: "babel-loader",
options: {
presets: [
"@babel/preset-env",
"@babel/typescript",
"@babel/preset-react",
],
plugins: [
"lodash",
"@babel/transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
],
},
},
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
},
],
},
resolve: {
extensions: [".js", ".ts", ".tsx"],
},
devtool: "source-map",
// devServer: {
// contentBase: path.join(__dirname, './'),
// hot: true,
// port: 9000,
// historyApiFallback: true
// },
plugins: [
new MomentLocalesPlugin(),
new CleanWebpackPlugin(),
// new HtmlWebpackPlugin({
// title: 'Hot Module Replacement',
// template: './public/index.html',
// }),
],
output: {
filename: "index.js",
path: path.resolve(__dirname, `./urbit/app/calendar/js`),
publicPath: "/",
hashFunction: "sha256",
},
optimization: {
minimize: true,
usedExports: true,
},
};