forked from bldrs-ai/Share
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cosmos.webpack.js
49 lines (47 loc) · 1.07 KB
/
.cosmos.webpack.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
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
module.exports = {
target: ['web', 'es2021'],
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devServer: {
publicPath: '/cosmos/',
contentBase: path.join(__dirname, 'docs'),
compress: true,
port: 8000,
},
output: {
path: path.resolve(__dirname, 'docs'),
publicPath: '/cosmos/',
filename: 'index.html',
},
plugins: [new HtmlWebpackPlugin()],
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules\/(?!@bldrs-ai\\conway)/, // Exclude all of node_modules except @bldrs-ai
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-react'],
},
},
},
{
test: /\.svg$/i,
use: {
loader: '@svgr/webpack',
options: {
dimensions: false
}
}
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.svg'],
},
optimization: {
minimize: false
},
}