@fmsim/builder 2.0.1 → 3.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fmsim/builder",
3
- "version": "2.0.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Layout View 어플리케이션 빌드를 위해 구성된 모듈입니다.",
5
5
  "main": "index.js",
6
6
  "author": "Hearty Oh <heartyoh@hatiolab.com>",
@@ -73,6 +73,7 @@
73
73
  "sass-loader": "^16.0.4",
74
74
  "storybook": "^8.6.4",
75
75
  "terser": "^5.1.0",
76
+ "terser-webpack-plugin": "^5.6.1",
76
77
  "text-loader": "^0.0.1",
77
78
  "ts-jest": "^29.1.0",
78
79
  "ts-node": "^10.9.1",
@@ -83,5 +84,5 @@
83
84
  "webpack-dev-server": "^5.2.0",
84
85
  "workbox-webpack-plugin": "^7.0.0"
85
86
  },
86
- "gitHead": "a5336bd252e398b021c4a025fad0eb3b501f35f2"
87
+ "gitHead": "23b7fedf8bb2b70b1150b963bd0f75d77a26052d"
87
88
  }
File without changes
@@ -98,14 +98,7 @@ class FolderOverridePlugin {
98
98
 
99
99
  this.writtenFrom[filepath].webpackTo = webpackTo
100
100
 
101
- compilation.assets[webpackTo] = {
102
- size() {
103
- return stat.size
104
- },
105
- source() {
106
- return content
107
- }
108
- }
101
+ compilation.assets[webpackTo] = new compilation.compiler.webpack.sources.RawSource(content)
109
102
  }
110
103
  }
111
104
 
@@ -75,14 +75,7 @@ class I18nBundlerPlugin {
75
75
 
76
76
  // debug(`Restoring locale '${locale}' resource into '${localePath}'`)
77
77
 
78
- compilation.assets[localePath] = {
79
- source: function () {
80
- return content
81
- },
82
- size: function () {
83
- return content.length
84
- }
85
- }
78
+ compilation.assets[localePath] = new compiler.webpack.sources.RawSource(content)
86
79
  }
87
80
  })
88
81
 
package/webpack.config.js CHANGED
@@ -6,6 +6,7 @@ const HTMLWebpackPlugin = require('html-webpack-plugin')
6
6
  const I18nBundlerPlugin = require('./webpack-plugins/i18n-bundler-plugin')
7
7
  const FolderOverridePlugin = require('./webpack-plugins/folder-override-plugin')
8
8
  const WorkboxWebpackPlugin = require('workbox-webpack-plugin')
9
+ const TerserPlugin = require('terser-webpack-plugin')
9
10
  const MiniCssExtractPlugin = require('mini-css-extract-plugin')
10
11
  const ThemeOverridePlugin = require('./webpack-plugins/theme-override-plugin')
11
12
  const EntryBuilder = require('./controller/entries-builder')
@@ -77,7 +78,15 @@ module.exports = {
77
78
  aliasFields: ['browser'],
78
79
  alias: {
79
80
  [AppPackage.name]:
80
- AppPackage.name == '@hatiolab/things-scene' ? path.resolve(appRootPath, 'dist', 'index.js') : appRootPath
81
+ AppPackage.name == '@hatiolab/things-scene' ? path.resolve(appRootPath, 'dist', 'index.js') : appRootPath,
82
+ /* 씬 컴포넌트 일괄 등록 — `import 'things-scene-components'` 는 빌더의 앵커 하나를 가리킨다 (things-factory builder 와 같다).
83
+ * 아래 로더 규칙이 내용을 생성하지만, 웹팩은 로더를 적용하기 전에 경로를 해소해야 하므로 실재하는 앵커 파일이 필요하다. */
84
+ 'things-scene-components': path.resolve(BuilderModulePath, 'web-loaders', 'things-scene-components.import'),
85
+ 'things-scene-components-with-tools': path.resolve(
86
+ BuilderModulePath,
87
+ 'web-loaders',
88
+ 'things-scene-components-with-tools.import'
89
+ )
81
90
  },
82
91
  extensions: ['.ts', '.js', '.jsx', '.tsx', '.json'],
83
92
  extensionAlias: {
@@ -96,6 +105,14 @@ module.exports = {
96
105
  chunkFilename: 'fmsim/[name].js',
97
106
  publicPath: '/'
98
107
  },
108
+ optimization: {
109
+ minimize: true,
110
+ minimizer: [
111
+ new TerserPlugin({
112
+ exclude: /\/capabilities\/WebGPU\.js$|\/webgpu\/WebGPUBackend\.js$/ // three 의 WebGPU.js·WebGPUBackend.js 는 줄이지 않는다 (things-factory builder 와 같다)
113
+ })
114
+ ]
115
+ },
99
116
  module: {
100
117
  rules: [
101
118
  {