@udi-organization/udi-package 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1,46 +0,0 @@
1
- // webpack.config.cjs
2
- const path = require('path');
3
-
4
- module.exports = (env, argv) => {
5
- const isDev = argv.mode === 'development';
6
-
7
- return {
8
- mode: isDev ? 'development' : 'production',
9
- entry: './src/index.js',
10
- output: {
11
- path: path.resolve(__dirname, 'dist'),
12
- filename: 'index.js',
13
- library: { type: 'module' }, // 產出 ESM
14
- module: true,
15
- environment: { module: true },
16
- clean: true, // ✅ 每次打包前清空 dist
17
- },
18
- experiments: {
19
- outputModule: true,
20
- },
21
- devtool: isDev ? 'source-map' : false, // ✅ dev 才輸出 source map
22
- module: {
23
- rules: [
24
- {
25
- test: /\.(js|jsx)$/,
26
- exclude: /node_modules/,
27
- use: 'babel-loader',
28
- },
29
- {
30
- test: /\.css$/,
31
- use: ['style-loader', 'css-loader'],
32
- },
33
- ],
34
- },
35
- resolve: {
36
- extensions: ['.js', '.jsx'],
37
- },
38
- externals: {
39
- react: 'react',
40
- 'react-dom': 'react-dom',
41
- },
42
- optimization: {
43
- minimize: !isDev, // prod 才壓縮
44
- },
45
- };
46
- };