flo-mat 3.0.3 → 3.0.5

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.
@@ -4,80 +4,100 @@
4
4
  const path = require('path');
5
5
 
6
6
 
7
- const config_Basic = {
8
- mode: 'production',
9
- // mode: 'development',
10
- entry: './src/index.ts',
11
- resolve: {
12
- extensions: [
13
- '.js', '.mjs', '.cjs',
14
- '.jsx', '.cjsx', '.mjsx',
15
- '.tsx', '.ts', '.d.ts'
16
- ],
17
- extensionAlias: {
18
- ".js": [".js", ".ts"],
19
- ".cjs": [".cjs", ".cts"],
20
- ".mjs": [".mjs", ".mts"]
7
+ const config_Basic = (env, argv) => {
8
+ const mode = argv.mode === 'production'
9
+ ? 'production'
10
+ : 'development';
11
+
12
+ const devtool = mode === 'production'
13
+ ? false
14
+ : 'eval-cheap-module-source-map';
15
+
16
+ return {
17
+ mode,
18
+ devtool,
19
+ output: {
20
+ path: path.resolve(__dirname, 'browser'),
21
+ library: { type: 'module' }
22
+ },
23
+ entry: './src/index.ts',
24
+ resolve: {
25
+ extensions: [
26
+ '.js', '.mjs', '.cjs',
27
+ '.jsx', '.cjsx', '.mjsx',
28
+ '.tsx', '.ts', '.d.ts'
29
+ ],
30
+ extensionAlias: {
31
+ ".js": [".js", ".ts"],
32
+ ".cjs": [".cjs", ".cts"],
33
+ ".mjs": [".mjs", ".mts"]
34
+ },
35
+ alias: {}
36
+ },
37
+ module: {
38
+ rules: [{
39
+ test: /\.tsx?$/,
40
+ use: [{
41
+ loader: 'ts-loader',
42
+ options: { silent: true }
43
+ }],
44
+ exclude: /node_modules/,
45
+ sideEffects: false
46
+ }]
47
+ },
48
+ stats: {
49
+ // Don't display most things
50
+ all: false,
51
+ colors: true,
52
+ errors: true,
53
+ builtAt: true
21
54
  },
22
- alias: {}
23
- },
24
- module: {
25
- rules: [{
26
- test: /\.tsx?$/,
27
- loader: 'ts-loader',
28
- options: { silent: true },
29
- exclude: /node_modules/,
30
- sideEffects: false
31
- }]
32
- },
33
- stats: {
34
- // Don't display most things
35
- all: false,
36
- colors: true,
37
- errors: true,
38
- builtAt: true
39
- },
40
- plugins: [
41
- // new CircularDependencyPlugin({
42
- // // exclude detection of files based on a RegExp
43
- // exclude: /node_modules/,
44
- // // add errors to webpack instead of warnings
45
- // failOnError: true,
46
- // // set the current working directory for displaying module paths
47
- // cwd: process.cwd(),
48
- // })
49
- ],
50
- output: {
51
- path: path.resolve(__dirname, 'browser'),
52
- library: { type: 'module' }
53
- },
54
- experiments: { outputModule: true }
55
+ plugins: [
56
+ // new CircularDependencyPlugin({
57
+ // // exclude detection of files based on a RegExp
58
+ // exclude: /node_modules/,
59
+ // // add errors to webpack instead of warnings
60
+ // failOnError: true,
61
+ // // set the current working directory for displaying module paths
62
+ // cwd: process.cwd(),
63
+ // })
64
+ ],
65
+ experiments: { outputModule: true }
66
+ };
55
67
  }
56
68
 
57
69
 
58
70
  /** ESM, minified */
59
- const config_EsmMinify = {
60
- ...config_Basic,
61
- output: {
62
- ...config_Basic.output,
63
- filename: 'index.min.js',
64
- },
65
- optimization: { minimize: true }
71
+ const config_EsmMinify = (env, argv) => {
72
+ const baseConfig = config_Basic(env, argv);
73
+
74
+ return {
75
+ ...baseConfig,
76
+ output: {
77
+ ...baseConfig.output,
78
+ filename: 'index.min.js',
79
+ },
80
+ optimization: { minimize: true }
81
+ };
66
82
  };
67
83
 
68
84
 
69
85
  /** ESM, not minified */
70
- // const config_EsmNoMinify = {
71
- // ...config_Basic,
72
- // output: {
73
- // ...config_Basic.output,
74
- // filename: 'index.js',
75
- // },
76
- // optimization: { minimize: false },
77
- // };
86
+ const config_EsmNoMinify = (env, argv) => {
87
+ const baseConfig = config_Basic(env, argv);
88
+
89
+ return {
90
+ ...baseConfig,
91
+ output: {
92
+ ...baseConfig.output,
93
+ filename: 'index.js',
94
+ },
95
+ optimization: { minimize: false },
96
+ };
97
+ };
78
98
 
79
99
 
80
100
  module.exports = [
81
101
  config_EsmMinify,
82
- // config_EsmNoMinify
102
+ config_EsmNoMinify
83
103
  ];
@@ -1,2 +0,0 @@
1
- declare function sleep(ms: number): Promise<unknown>;
2
- export { sleep };
@@ -1,5 +0,0 @@
1
- function sleep(ms) {
2
- return new Promise(resolve => setTimeout(resolve, ms));
3
- }
4
- export { sleep };
5
- //# sourceMappingURL=sleep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"AACA,SAAS,KAAK,CAAC,EAAU;IACrB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}