-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
111 lines (108 loc) · 2.97 KB
/
webpack.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const path = require('path');
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const smp = new SpeedMeasurePlugin();
module.exports = smp.wrap({
entry: './src/index.js',
mode: 'development',
devtool: 'inline-source-map',
node: { fs: 'empty', },
output: {
path: path.resolve(__dirname, 'build'),
filename: 'static/js/[name].[contenthash:8].js',
publicPath: '/'
},
resolve: {
extensions: ['*', '.js', '.json', '.ts', '.tsx', '.jsx'],
symlinks: false,
alias: {
'@metacell/geppetto-meta-client': path.resolve(__dirname, 'node_modules/@metacell/geppetto-meta-client/src'),
'@metacell/geppetto-meta-ui': path.resolve(__dirname, 'node_modules/@metacell/geppetto-meta-ui/src'),
'@metacell/geppetto-meta-core': path.resolve(__dirname, 'node_modules/@metacell/geppetto-meta-core/src'),
},
},
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules/@metacell/geppetto-meta-ui/src'),
path.resolve(__dirname, 'node_modules/@metacell/geppetto-meta-client/src'),
path.resolve(__dirname, 'node_modules/@metacell/geppetto-meta-core/src'),
],
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env'],
'@babel/preset-react',
{ plugins: ['module-resolver', '@babel/plugin-proposal-class-properties'] },
],
},
},
{
test: /\.html$/,
use: [{ loader: 'html-loader' }],
},
{
test: /\.svg/,
use: {
loader: 'svg-url-loader',
options: {},
},
},
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader']
},
{
test: /\.s[a|c]ss$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'sass-loader' },
],
},
{
test: /\.(png|gif|jpg|cur)$/i,
loader: 'url-loader',
},
{
test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
loader: 'url-loader',
options: { limit: 10000, mimetype: 'application/font-woff2' },
},
{
test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
loader: 'url-loader',
options: { limit: 10000, mimetype: 'application/font-woff' },
},
{
test: /\.(ttf|eot|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
loader: 'file-loader',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.md$/,
use: [{ loader: 'html-loader' }, { loader: 'markdown-loader' }],
},
{
test: /\.dat$/i,
use: [
{
loader: 'raw-loader',
options: { esModule: false, },
},
],
},
{
test: /\.obj|\.drc|\.gltf/,
loader: 'url-loader',
},
],
},
plugins: [
],
});