@meteorjs/rspack 0.0.2 → 0.0.3
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 +1 -1
- package/rspack.config.js +5 -4
package/package.json
CHANGED
package/rspack.config.js
CHANGED
|
@@ -42,13 +42,13 @@ function createCacheStrategy(mode) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// SWC loader rule (JSX/JS)
|
|
45
|
-
function createSwcConfig({ isRun,
|
|
45
|
+
function createSwcConfig({ isRun, isTypescriptEnabled, isJsxEnabled, isTsxEnabled }) {
|
|
46
46
|
const defaultConfig = {
|
|
47
47
|
jsc: {
|
|
48
48
|
baseUrl: process.cwd(),
|
|
49
49
|
paths: { '/*': ['*'] },
|
|
50
50
|
parser: {
|
|
51
|
-
syntax:
|
|
51
|
+
syntax: isTypescriptEnabled ? 'typescript' : 'ecmascript',
|
|
52
52
|
...(isTsxEnabled && { tsx: true }),
|
|
53
53
|
...(isJsxEnabled && { jsx: true }),
|
|
54
54
|
},
|
|
@@ -101,7 +101,7 @@ export default function (inMeteor = {}, argv = {}) {
|
|
|
101
101
|
const isReactEnabled = Meteor.isReactEnabled;
|
|
102
102
|
const mode = isProd ? 'production' : 'development';
|
|
103
103
|
|
|
104
|
-
const
|
|
104
|
+
const isTypescriptEnabled = Meteor.isTypescriptEnabled || false;
|
|
105
105
|
const isJsxEnabled = Meteor.isJsxEnabled || false;
|
|
106
106
|
const isTsxEnabled = Meteor.isTsxEnabled || false;
|
|
107
107
|
|
|
@@ -134,10 +134,11 @@ export default function (inMeteor = {}, argv = {}) {
|
|
|
134
134
|
|
|
135
135
|
const swcConfig = createSwcConfig({
|
|
136
136
|
isRun,
|
|
137
|
-
|
|
137
|
+
isTypescriptEnabled,
|
|
138
138
|
isJsxEnabled,
|
|
139
139
|
isTsxEnabled,
|
|
140
140
|
});
|
|
141
|
+
console.log("--> (rspack.config.js-Line: 141)\n swcConfig: ", swcConfig?.options?.jsc);
|
|
141
142
|
const externals = [
|
|
142
143
|
/^meteor.*/,
|
|
143
144
|
...(isReactEnabled ? [/^react$/, /^react-dom$/] : [])
|