@mainset/bundler-webpack 0.1.0 → 0.2.0-rc.1

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.
@@ -0,0 +1,18 @@
1
+ import { resolveHostPackageNodeModulesPath, runtimePathById, } from '@mainset/cli/runtime';
2
+ import { merge } from '@mainset/toolkit-js';
3
+ import fs from 'fs';
4
+ import path from 'path';
5
+ import { commonWebpackConfigFragment } from './common.fragment.mjs';
6
+ // The entry point for Global styles
7
+ const cssGlobalStylesEntry = path.join(runtimePathById.src, 'styles', 'global.css');
8
+ const scssGlobalStylesEntry = path.join(runtimePathById.src, 'styles', 'global.scss');
9
+ const globalStylesEntry = fs.existsSync(scssGlobalStylesEntry)
10
+ ? scssGlobalStylesEntry
11
+ : cssGlobalStylesEntry;
12
+ const commonWebappWebpackConfigFragment = merge(commonWebpackConfigFragment, {
13
+ entry: [
14
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', '@babel/polyfill'),
15
+ globalStylesEntry,
16
+ ],
17
+ });
18
+ export { commonWebappWebpackConfigFragment };
@@ -1,35 +1,17 @@
1
- import { resolveHostPackageNodeModulesPath, runtimePathById, } from '@mainset/cli/runtime';
2
- import babelConfig from '../../babel.config.mjs';
1
+ import { runtimePathById } from '@mainset/cli/runtime';
2
+ import { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT, } from './module-rules/index.mjs';
3
3
  const commonWebpackConfigFragment = {
4
4
  output: {
5
5
  path: runtimePathById.dist,
6
6
  },
7
7
  module: {
8
8
  rules: [
9
- {
10
- test: /\.(ts|tsx)$/,
11
- exclude: /node_modules/,
12
- use: {
13
- loader: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'babel-loader'),
14
- options: babelConfig,
15
- },
16
- },
17
- {
18
- test: /\.(svg|png)$/,
19
- type: 'asset/resource',
20
- generator: {
21
- filename: '[name].[hash].[ext]',
22
- outputPath: 'dist/assets/images',
23
- },
24
- },
25
- {
26
- test: /\.(woff|woff2|eot|ttf|otf)$/,
27
- type: 'asset/resource',
28
- generator: {
9
+ BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT,
10
+ IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT,
11
+ Object.assign(Object.assign({}, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { type: 'asset/resource', generator: {
29
12
  filename: '[name].[hash].[ext]',
30
13
  outputPath: 'dist/assets/fonts',
31
- },
32
- },
14
+ } }),
33
15
  ],
34
16
  },
35
17
  resolve: {
@@ -1,15 +1,13 @@
1
- import { resolveHostPackageNodeModulesPath, runtimePathById, } from '@mainset/cli/runtime';
1
+ import { runtimePathById } from '@mainset/cli/runtime';
2
2
  import { merge } from '@mainset/toolkit-js';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
- import { commonWebpackConfigFragment } from './common.fragment.mjs';
5
+ import { commonWebappWebpackConfigFragment } from './common-webapp.fragment.mjs';
6
+ // The entry point for the CSR webapp
6
7
  const defaultEntry = path.join(runtimePathById.src, 'index.ts');
7
8
  const csrEntry = path.join(runtimePathById.src, 'index.csr.ts');
8
9
  const bundlerEntry = fs.existsSync(csrEntry) ? csrEntry : defaultEntry;
9
- const csrWebappWebpackConfigFragment = merge(commonWebpackConfigFragment, {
10
- entry: [
11
- resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', '@babel/polyfill'),
12
- bundlerEntry,
13
- ],
10
+ const csrWebappWebpackConfigFragment = merge(commonWebappWebpackConfigFragment, {
11
+ entry: [bundlerEntry],
14
12
  });
15
13
  export { csrWebappWebpackConfigFragment };
@@ -1,8 +1,35 @@
1
+ import { resolveHostPackageNodeModulesPath } from '@mainset/cli/runtime';
2
+ import { CSS_LOADER__DEV_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, } from './module-rules/index.mjs';
1
3
  const devWebpackConfigFragment = {
2
4
  mode: 'development',
3
5
  output: {
4
6
  filename: 'js/[name].js',
5
7
  chunkFilename: 'js/[id].js',
6
8
  },
9
+ module: {
10
+ rules: [
11
+ Object.assign(Object.assign({}, CSS_STYLES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { oneOf: [
12
+ Object.assign(Object.assign({}, CSS_MODULES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { use: [
13
+ // NOTE: do NOT use {style-loader} in {production} mode
14
+ // https://webpack.js.org/loaders/style-loader/#recommended
15
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'style-loader'),
16
+ // NOTE: by default {css-loader} transforms CSS Modules to hashed class names
17
+ // which is not development-friendly
18
+ CSS_LOADER__DEV_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
19
+ ...CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
20
+ ] }),
21
+ // Pure CSS support without CSS Modules
22
+ {
23
+ use: [
24
+ // NOTE: do NOT use {style-loader} in {production} mode
25
+ // https://webpack.js.org/loaders/style-loader/#recommended
26
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'style-loader'),
27
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'css-loader'),
28
+ ...CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
29
+ ],
30
+ },
31
+ ] }),
32
+ ],
33
+ },
7
34
  };
8
35
  export { devWebpackConfigFragment };
@@ -0,0 +1,2 @@
1
+ export * from './module-rules.fragment.mjs';
2
+ export * from './module-rules.chunk.mjs';
@@ -0,0 +1,46 @@
1
+ import { resolveHostPackageNodeModulesPath, runtimePathById, } from '@mainset/cli/runtime';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ // RegEx patterns for matching module rules in Webpack configuration
5
+ const CSS_STYLES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK = {
6
+ test: /\.(sa|sc|c)ss$/,
7
+ };
8
+ const CSS_MODULES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK = {
9
+ test: /\.module\.(sa|sc|c)ss$/,
10
+ };
11
+ const FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK = {
12
+ test: /\.(woff|woff2|eot|ttf|otf)$/,
13
+ };
14
+ // Use options for CSS loader rule in Webpack configuration
15
+ const CSS_LOADER__PROD_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK = {
16
+ loader: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'css-loader'),
17
+ };
18
+ const CSS_LOADER__DEV_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK = {
19
+ loader: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'css-loader'),
20
+ // NOTE: by default {css-loader} transforms CSS Modules to hashed class names
21
+ // which is not development-friendly
22
+ options: {
23
+ modules: {
24
+ // hashed class names
25
+ localIdentName: '[local]--[hash:base64:5]',
26
+ },
27
+ },
28
+ };
29
+ // Use options for CSS styles rule in Webpack configuration
30
+ const postcssConfigPath = path.join(runtimePathById.root, 'config', 'postcss.config.cjs');
31
+ const CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK = [
32
+ // resolveHostPackageNodeModulesPath(
33
+ // '@mainset/bundler-webpack',
34
+ // 'resolve-url-loader',
35
+ // ),
36
+ {
37
+ loader: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'postcss-loader'),
38
+ options: {
39
+ postcssOptions: {
40
+ config: fs.existsSync(postcssConfigPath) && postcssConfigPath,
41
+ },
42
+ },
43
+ },
44
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'sass-loader'),
45
+ ];
46
+ export { 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, };
@@ -0,0 +1,19 @@
1
+ import { resolveHostPackageNodeModulesPath } from '@mainset/cli/runtime';
2
+ import babelConfig from '../../../babel.config.mjs';
3
+ const BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT = {
4
+ test: /\.(ts|mts|tsx)$/,
5
+ exclude: /node_modules/,
6
+ use: {
7
+ loader: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'babel-loader'),
8
+ options: babelConfig,
9
+ },
10
+ };
11
+ const IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT = {
12
+ test: /\.(svg|png)$/,
13
+ type: 'asset/resource',
14
+ generator: {
15
+ filename: '[name].[hash].[ext]',
16
+ outputPath: 'dist/assets/images',
17
+ },
18
+ };
19
+ export { IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT, BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, };
@@ -1,4 +1,7 @@
1
+ import { resolveHostPackageNodeModulesPath } from '@mainset/cli/runtime';
2
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
1
3
  import TerserPlugin from 'terser-webpack-plugin';
4
+ import { 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, } from './module-rules/index.mjs';
2
5
  const prodWebpackConfigFragment = {
3
6
  mode: 'production',
4
7
  output: {
@@ -20,5 +23,33 @@ const prodWebpackConfigFragment = {
20
23
  },
21
24
  },
22
25
  },
26
+ module: {
27
+ rules: [
28
+ Object.assign(Object.assign({}, CSS_STYLES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { oneOf: [
29
+ Object.assign(Object.assign({}, CSS_MODULES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { use: [
30
+ MiniCssExtractPlugin.loader,
31
+ // NOTE: allow {css-loader} to transform CSS Modules to hashed class names
32
+ CSS_LOADER__PROD_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
33
+ ...CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
34
+ ] }),
35
+ // Pure CSS support without CSS Modules
36
+ {
37
+ use: [
38
+ MiniCssExtractPlugin.loader,
39
+ // NOTE: do NOT transform Global CSS class names to hashed class names
40
+ // as there is regular string used as class in the app code which will not be transformed
41
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'css-loader'),
42
+ ...CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
43
+ ],
44
+ },
45
+ ] }),
46
+ ],
47
+ },
48
+ plugins: [
49
+ new MiniCssExtractPlugin({
50
+ filename: 'css/[name].[chunkhash:8].min.css',
51
+ chunkFilename: 'css/[id].[chunkhash:8].min.css',
52
+ }),
53
+ ],
23
54
  };
24
55
  export { prodWebpackConfigFragment };
@@ -1,18 +1,18 @@
1
- import { resolveHostPackageNodeModulesPath, runtimePathById, } from '@mainset/cli/runtime';
1
+ import { runtimePathById } from '@mainset/cli/runtime';
2
2
  import { merge } from '@mainset/toolkit-js';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
- import { commonWebpackConfigFragment } from './common.fragment.mjs';
5
+ import { commonWebappWebpackConfigFragment } from './common-webapp.fragment.mjs';
6
+ // The entry point for the SSR webapp
6
7
  const defaultEntry = path.join(runtimePathById.src, 'index.ts');
7
8
  const ssrEntry = path.join(runtimePathById.src, 'index.ssr.ts');
8
9
  const bundlerEntry = fs.existsSync(ssrEntry) ? ssrEntry : defaultEntry;
9
- const ssrWebappWebpackConfigFragment = merge(commonWebpackConfigFragment, {
10
- entry: [
11
- resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', '@babel/polyfill'),
12
- bundlerEntry,
13
- ],
10
+ const ssrWebappWebpackConfigFragment = merge(
11
+ // NOTE: the Web App config used to compile entry point of {global.css} styles
12
+ commonWebappWebpackConfigFragment, {
13
+ entry: [bundlerEntry],
14
14
  output: {
15
- path: path.join(commonWebpackConfigFragment.output.path, 'public'),
15
+ path: path.join(commonWebappWebpackConfigFragment.output.path, 'public'),
16
16
  },
17
17
  });
18
18
  export { ssrWebappWebpackConfigFragment };
@@ -1,7 +1,7 @@
1
1
  import { runtimePathById } from '@mainset/cli/runtime';
2
2
  import { merge } from '@mainset/toolkit-js';
3
3
  import csrWebappEnvBasedConfig from './webapp.csr.config.mjs';
4
- const csrServerDevConfig = merge(csrWebappEnvBasedConfig, {
4
+ const csrDevServerWebappEnvBasedConfig = merge(csrWebappEnvBasedConfig, {
5
5
  devtool: 'inline-source-map',
6
6
  devServer: {
7
7
  port: process.env.PORT || 3000,
@@ -12,4 +12,4 @@ const csrServerDevConfig = merge(csrWebappEnvBasedConfig, {
12
12
  hot: true,
13
13
  },
14
14
  });
15
- export default csrServerDevConfig;
15
+ export default csrDevServerWebappEnvBasedConfig;
@@ -0,0 +1,104 @@
1
+ import { NODE_ENV, resolveHostPackageNodeModulesPath, runtimePathById, } from '@mainset/cli/runtime';
2
+ import { merge } from '@mainset/toolkit-js';
3
+ import path from 'path';
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, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT, } from './config-fragments/module-rules/index.mjs';
6
+ const nullLoaderModuleRules = [
7
+ FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK,
8
+ ].map((ruleTestRegexWebpackConfigFragment) => (Object.assign(Object.assign({}, ruleTestRegexWebpackConfigFragment), { use: resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'null-loader') })));
9
+ const ssrServerCommonWebpackConfigFragment = {
10
+ // common config
11
+ resolve: commonWebpackConfigFragment.resolve,
12
+ // SSR server dedicated config
13
+ target: 'node',
14
+ entry: {
15
+ 'ssr-server.config': path.join(runtimePathById.root, 'config', 'ssr-server.config.mts'),
16
+ },
17
+ output: {
18
+ path: path.join(runtimePathById.dist, 'private'),
19
+ filename: '[name].mjs',
20
+ library: {
21
+ type: 'module',
22
+ },
23
+ },
24
+ experiments: {
25
+ outputModule: true,
26
+ },
27
+ /*
28
+ optimization: {
29
+ // !IMPORTANT: {splitChunks} is designed to optimize the client-side JavaScript
30
+ // When bundling for SSR, splitting chunks usually doesn't make sense, and even breaks SSR — because:
31
+ // - The server expects a single, self-contained entry file.
32
+ // - Lazy-loaded chunks may not be resolvable during SSR runtime.
33
+ splitChunks: false,
34
+ },
35
+ */
36
+ module: {
37
+ rules: [
38
+ // common config
39
+ BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT,
40
+ IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT,
41
+ // do NOT bundle in SSR mode, because they are not used during rendering on the server
42
+ ...nullLoaderModuleRules,
43
+ ],
44
+ },
45
+ };
46
+ const generateSSRCssStylesRuleWebpackConfigFragment = ({ mode }) => {
47
+ const CSS_LOADER__RULE_USE_OPTIONS__BY_MODE = {
48
+ [NODE_ENV.PRODUCTION]: CSS_LOADER__PROD_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
49
+ [NODE_ENV.DEVELOPMENT]: CSS_LOADER__DEV_RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
50
+ };
51
+ return Object.assign(Object.assign({}, CSS_STYLES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { oneOf: [
52
+ Object.assign(Object.assign({}, CSS_MODULES__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK), { use: [
53
+ // NOTE: allow {css-loader} to transform CSS Modules to hashed class names while rendering HTML
54
+ merge(CSS_LOADER__RULE_USE_OPTIONS__BY_MODE[mode], {
55
+ options: {
56
+ modules: {
57
+ // !IMPORTANT: attach transformed CSS Modules class names into HTML
58
+ // without compiling CSS inside JS file
59
+ exportOnlyLocals: true,
60
+ // - {exportOnlyLocals: true} tells css-loader to only export the mapping of class names to hashes
61
+ // (for use in SSR), and not to emit or bundle any CSS.
62
+ // - This allows your SSR code to inject the correct class names into the rendered HTML,
63
+ // without including or compiling CSS into the server bundle.
64
+ },
65
+ },
66
+ }, {
67
+ isSourceObjMutated: false,
68
+ }),
69
+ ...CSS_STYLES__RULE_USE_OPTIONS__WEBPACK_CONFIG_CHUNK,
70
+ ] }),
71
+ // Pure CSS support without CSS Modules
72
+ {
73
+ // do NOT bundle in SSR mode, because they are not used during rendering on the server
74
+ use: [
75
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', 'null-loader'),
76
+ ],
77
+ },
78
+ ] });
79
+ };
80
+ const ssrServerProdWebpackConfigFragment = {
81
+ mode: 'production',
82
+ module: {
83
+ rules: [
84
+ generateSSRCssStylesRuleWebpackConfigFragment({
85
+ mode: NODE_ENV.PRODUCTION,
86
+ }),
87
+ ],
88
+ },
89
+ };
90
+ const ssrServerDevWebpackConfigFragment = {
91
+ mode: 'development',
92
+ module: {
93
+ rules: [
94
+ generateSSRCssStylesRuleWebpackConfigFragment({
95
+ mode: NODE_ENV.DEVELOPMENT,
96
+ }),
97
+ ],
98
+ },
99
+ };
100
+ const ssrServerEnvBasedConfig = {
101
+ [NODE_ENV.PRODUCTION]: merge(ssrServerProdWebpackConfigFragment, ssrServerCommonWebpackConfigFragment),
102
+ [NODE_ENV.DEVELOPMENT]: merge(ssrServerDevWebpackConfigFragment, ssrServerCommonWebpackConfigFragment),
103
+ };
104
+ export default ssrServerEnvBasedConfig[process.env.NODE_ENV];
@@ -5,6 +5,7 @@ import path from 'path';
5
5
  import { devWebpackConfigFragment } from './config-fragments/dev.fragment.mjs';
6
6
  import { prodWebpackConfigFragment } from './config-fragments/prod.fragment.mjs';
7
7
  import { ssrWebappWebpackConfigFragment } from './config-fragments/ssr-webapp.fragment.mjs';
8
+ import ssrServerEnvBasedConfig from './server.ssr.config.mjs';
8
9
  const ssrWebappGeneralConfig = merge(ssrWebappWebpackConfigFragment, {
9
10
  plugins: [
10
11
  new HtmlWebpackPlugin({
@@ -17,4 +18,8 @@ const ssrWebappEnvBasedConfig = {
17
18
  [NODE_ENV.PRODUCTION]: merge(prodWebpackConfigFragment, ssrWebappGeneralConfig),
18
19
  [NODE_ENV.DEVELOPMENT]: merge(devWebpackConfigFragment, ssrWebappGeneralConfig),
19
20
  };
20
- export default ssrWebappEnvBasedConfig[process.env.NODE_ENV];
21
+ export default [
22
+ ssrServerEnvBasedConfig,
23
+ // NOTE: all Env Based configs declared outside {config-fragments} folder
24
+ ssrWebappEnvBasedConfig[process.env.NODE_ENV],
25
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mainset/bundler-webpack",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-rc.1",
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": {
@@ -15,8 +15,12 @@
15
15
  "type": "module",
16
16
  "sideEffects": false,
17
17
  "files": [
18
- "dist"
18
+ "dist",
19
+ "src/@types"
19
20
  ],
21
+ "exports": {
22
+ "./global-types": "./src/@types/bundler.d.ts"
23
+ },
20
24
  "dependencies": {
21
25
  "@babel/cli": "^7.27.2",
22
26
  "@babel/core": "^7.27.4",
@@ -25,15 +29,28 @@
25
29
  "@babel/preset-react": "^7.27.1",
26
30
  "@babel/preset-typescript": "^7.27.1",
27
31
  "babel-loader": "^10.0.0",
32
+ "css-loader": "^7.1.2",
28
33
  "html-webpack-plugin": "^5.6.3",
34
+ "mini-css-extract-plugin": "^2.9.2",
35
+ "null-loader": "^4.0.1",
36
+ "postcss": "^8.5.6",
37
+ "postcss-loader": "^8.1.1",
38
+ "sass": "^1.89.2",
39
+ "sass-loader": "^16.0.5",
40
+ "style-loader": "^4.0.0",
29
41
  "terser-webpack-plugin": "^5.3.14",
30
42
  "webpack": "^5.99.9",
31
43
  "webpack-cli": "^6.0.1",
32
44
  "webpack-dev-server": "^5.2.2"
33
45
  },
34
46
  "devDependencies": {
35
- "@mainset/dev-stack-fe": "^0.1.0",
36
- "@mainset/cli": "^0.1.0",
47
+ "@mainset/cli": "^0.2.0-rc.1",
48
+ "@mainset/dev-stack-fe": "^0.1.1",
49
+ "@mainset/toolkit-js": "^0.1.0"
50
+ },
51
+ "peerDependencies": {
52
+ "@mainset/cli": "^0.2.0",
53
+ "@mainset/dev-stack-fe": "^0.1.1",
37
54
  "@mainset/toolkit-js": "^0.1.0"
38
55
  },
39
56
  "scripts": {
@@ -0,0 +1,4 @@
1
+ declare module '*.module.scss' {
2
+ const styles: { [className: string]: string };
3
+ export = styles;
4
+ }