mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build(): change tsconfig to always use commonjs modules
This commit is contained in:
@@ -12,16 +12,9 @@ set -ex
|
||||
rm -rf ./dist
|
||||
rm -rf ./deploy
|
||||
|
||||
# For packaging for npm only, replace the TypeScript module format to commonjs.
|
||||
# Creates a tscongig.json.backup with the original file that we'll use to restore after building.
|
||||
sed -i.backup 's|"module": ".+"|"module": "commonjs"|g' ./src/tsconfig.json
|
||||
|
||||
# Perform a build with the modified tsconfig.json.
|
||||
ng build
|
||||
|
||||
# Return tsconfig.json to its original state.
|
||||
mv -f ./src/tsconfig.json.backup ./src/tsconfig.json
|
||||
|
||||
# Inline the css and html into the component ts files.
|
||||
./node_modules/gulp/bin/gulp.js inline-resources
|
||||
|
||||
|
||||
+3
-3
@@ -23,15 +23,15 @@
|
||||
System.config({
|
||||
packages: {
|
||||
'demo-app': {
|
||||
format: 'register',
|
||||
format: 'cjs',
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'components': {
|
||||
format: 'register',
|
||||
format: 'cjs',
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
'core': {
|
||||
format: 'register',
|
||||
format: 'cjs',
|
||||
defaultExtension: 'js'
|
||||
},
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"mapRoot": "",
|
||||
"module": "system",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"noEmitOnError": true,
|
||||
"noImplicitAny": true,
|
||||
|
||||
Reference in New Issue
Block a user