@mainset/bundler-webpack 0.3.3-rc.1 → 0.3.3-rc.2
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.
- package/dist/esm/webpack-config/config-fragments/common.fragment.mjs +2 -2
- package/dist/esm/webpack-config/config-fragments/module-rules/module-rules.fragment.mjs +15 -8
- package/dist/esm/webpack-config/server.ssr.config.mjs +2 -2
- package/dist/types/webpack-config/config-fragments/module-rules/module-rules.fragment.d.mts +2 -2
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { runtimePathById } from '@mainset/cli/runtime';
|
|
2
|
-
import { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK,
|
|
2
|
+
import { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS, } from './module-rules/index.mjs';
|
|
3
3
|
const commonWebpackConfigFragment = {
|
|
4
4
|
output: {
|
|
5
5
|
path: runtimePathById.dist,
|
|
@@ -7,7 +7,7 @@ const commonWebpackConfigFragment = {
|
|
|
7
7
|
module: {
|
|
8
8
|
rules: [
|
|
9
9
|
BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT,
|
|
10
|
-
|
|
10
|
+
...IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS,
|
|
11
11
|
Object.assign(Object.assign({}, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { type: 'asset/resource', generator: {
|
|
12
12
|
filename: '[name].[hash].[ext]',
|
|
13
13
|
outputPath: 'dist/assets/fonts',
|
|
@@ -10,12 +10,19 @@ const BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT = {
|
|
|
10
10
|
options: babelConfig,
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS = [
|
|
14
|
+
{
|
|
15
|
+
test: /\.(svg|png)$/,
|
|
16
|
+
exclude: /\.source\.svg$/,
|
|
17
|
+
type: 'asset/resource',
|
|
18
|
+
generator: {
|
|
19
|
+
filename: '[name].[hash].[ext]',
|
|
20
|
+
outputPath: 'dist/assets/images',
|
|
21
|
+
},
|
|
19
22
|
},
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
{
|
|
24
|
+
test: /\.source\.svg$/,
|
|
25
|
+
type: 'asset/source',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
export { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS, };
|
|
@@ -2,7 +2,7 @@ import { NODE_ENV, resolveHostPackageNodeModulesPath, runtimePathById, } from '@
|
|
|
2
2
|
import { merge } from '@mainset/toolkit-js';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { commonWebpackConfigFragment } from './config-fragments/common.fragment.mjs';
|
|
5
|
-
import { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, CSS_LOADER__DEV_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK, CSS_LOADER__PROD_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK, CSS_MODULES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, CSS_STYLES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK,
|
|
5
|
+
import { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, CSS_LOADER__DEV_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK, CSS_LOADER__PROD_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK, CSS_MODULES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, CSS_STYLES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS, } from './config-fragments/module-rules/index.mjs';
|
|
6
6
|
const nullLoaderModuleRules = [
|
|
7
7
|
FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK,
|
|
8
8
|
].map((ruleTestRegexWebpackConfigFragment) => (Object.assign(Object.assign({}, ruleTestRegexWebpackConfigFragment), { use: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'null-loader') })));
|
|
@@ -37,7 +37,7 @@ const ssrServerCommonWebpackConfigFragment = {
|
|
|
37
37
|
rules: [
|
|
38
38
|
// common config
|
|
39
39
|
BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT,
|
|
40
|
-
|
|
40
|
+
...IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS,
|
|
41
41
|
// do NOT bundle in SSR mode, because they are not used during rendering on the server
|
|
42
42
|
...nullLoaderModuleRules,
|
|
43
43
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RuleSetRule } from 'webpack';
|
|
2
2
|
declare const BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT: RuleSetRule;
|
|
3
|
-
declare const
|
|
4
|
-
export { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT,
|
|
3
|
+
declare const IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS: RuleSetRule[];
|
|
4
|
+
export { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENTS, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainset/bundler-webpack",
|
|
3
|
-
"version": "0.3.3-rc.
|
|
3
|
+
"version": "0.3.3-rc.2",
|
|
4
4
|
"description": "Bundler for web apps",
|
|
5
5
|
"homepage": "https://github.com/mainset/dev-stack-fe/tree/main/packages/bundler-webpack",
|
|
6
6
|
"bugs": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@mainset/cli": "^0.5.0",
|
|
53
|
-
"@mainset/
|
|
54
|
-
"@mainset/
|
|
53
|
+
"@mainset/toolkit-js": "^0.2.0-rc.1",
|
|
54
|
+
"@mainset/dev-stack-fe": "^0.2.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@mainset/cli": ">=0.5.0 <1.0.0",
|