Skip to content

Commit 40d3f0c

Browse files
committed
build(): change tsconfig to always use commonjs modules
1 parent ead66f7 commit 40d3f0c

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

scripts/release/stage-release.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,9 @@ set -ex
1212
rm -rf ./dist
1313
rm -rf ./deploy
1414

15-
# For packaging for npm only, replace the TypeScript module format to commonjs.
16-
# Creates a tscongig.json.backup with the original file that we'll use to restore after building.
17-
sed -i.backup 's|"module": ".+"|"module": "commonjs"|g' ./src/tsconfig.json
18-
1915
# Perform a build with the modified tsconfig.json.
2016
ng build
2117

22-
# Return tsconfig.json to its original state.
23-
mv -f ./src/tsconfig.json.backup ./src/tsconfig.json
24-
2518
# Inline the css and html into the component ts files.
2619
./node_modules/gulp/bin/gulp.js inline-resources
2720

src/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
System.config({
2424
packages: {
2525
'demo-app': {
26-
format: 'register',
26+
format: 'cjs',
2727
defaultExtension: 'js'
2828
},
2929
'components': {
30-
format: 'register',
30+
format: 'cjs',
3131
defaultExtension: 'js'
3232
},
3333
'core': {
34-
format: 'register',
34+
format: 'cjs',
3535
defaultExtension: 'js'
3636
},
3737
}

src/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"emitDecoratorMetadata": true,
55
"experimentalDecorators": true,
66
"mapRoot": "",
7-
"module": "system",
7+
"module": "commonjs",
88
"moduleResolution": "node",
99
"noEmitOnError": true,
1010
"noImplicitAny": true,

0 commit comments

Comments
 (0)