build: Configure AOT (#394)

* build: Configure AOT

* build: Fix appveyor ENV settings
This commit is contained in:
Róbert Kiss
2017-08-26 00:56:28 +02:00
committed by László Monda
parent 015d110c2b
commit be3e116130
9 changed files with 1968 additions and 8049 deletions

View File

@@ -1,5 +1,8 @@
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ContextReplacementPlugin = require("webpack/lib/ContextReplacementPlugin")
const webpackHelper = require('../../scripts/webpack-helper');
const rootDir = __dirname;
@@ -35,6 +38,11 @@ module.exports = {
to: 'package.json'
}
]
),
new ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
webpackHelper.root(__dirname, './src') // location of your src
)
],
node: {
@@ -42,4 +50,4 @@ module.exports = {
__filename: false
}
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build": "ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
@@ -14,18 +14,18 @@
},
"private": true,
"devDependencies": {
"@angular/animations": "^4.3.3",
"@angular/cli": "^1.3.0-rc.5",
"@angular/common": "^4.3.3",
"@angular/compiler": "^4.3.3",
"@angular/compiler-cli": "^4.3.3",
"@angular/core": "^4.3.3",
"@angular/forms": "^4.3.3",
"@angular/http": "^4.3.3",
"@angular/language-service": "^4.3.3",
"@angular/platform-browser": "^4.3.3",
"@angular/platform-browser-dynamic": "^4.3.3",
"@angular/router": "^4.3.3",
"@angular/animations": "^4.3.6",
"@angular/cli": "^1.3.2",
"@angular/common": "^4.3.6",
"@angular/compiler": "^4.3.6",
"@angular/compiler-cli": "^4.3.6",
"@angular/core": "^4.3.6",
"@angular/forms": "^4.3.6",
"@angular/http": "^4.3.6",
"@angular/language-service": "^4.3.6",
"@angular/platform-browser": "^4.3.6",
"@angular/platform-browser-dynamic": "^4.3.6",
"@angular/router": "^4.3.6",
"@ngrx/core": "1.2.0",
"@ngrx/effects": "^2.0.4",
"@ngrx/router-store": "^1.2.6",
@@ -38,7 +38,6 @@
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/jquery": "^3.2.9",
"@types/node": "~8.0.19",
"@types/node-hid": "^0.5.2",
"@types/usb": "^1.1.3",
"angular-notifier": "^2.0.0",
@@ -48,7 +47,6 @@
"circular-dependency-plugin": "^3.0.0",
"codelyzer": "~3.0.1",
"copy-webpack-plugin": "^4.0.1",
"core-js": "^2.4.1",
"css-loader": "^0.28.1",
"cssnano": "^3.10.0",
"dragula": "^3.7.2",

View File

@@ -36,7 +36,7 @@ export class KeymapEditComponent {
keyboardSplit: boolean;
deletable$: Observable<boolean>;
protected keymap$: Observable<Keymap>;
keymap$: Observable<Keymap>;
constructor(protected store: Store<AppState>,
route: ActivatedRoute) {

View File

@@ -1,5 +1,4 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../uhk-agent/dist/out-tsc",
"sourceMap": true,
@@ -16,6 +15,9 @@
"es2015.iterable",
"dom",
"es2016"
]
],
"paths": {
"@angular/*": ["../node_modules/@angular/*"]
}
}
}

View File

@@ -1,3 +1,5 @@
const AOT_BUILD = process.env.AOT_BUILD;
const fs = require('fs');
const path = require('path');
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
@@ -15,7 +17,7 @@ const nodeModules = path.join(process.cwd(), 'node_modules');
const realNodeModules = fs.realpathSync(nodeModules);
const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules');
const entryPoints = ["inline","polyfills","sw-register","scripts","styles","vendor","main"];
const minimizeCss = false;
const minimizeCss = AOT_BUILD;
const baseHref = "";
const deployUrl = "";
const postcssPlugins = function () {
@@ -442,7 +444,7 @@ module.exports = {
},
"exclude": [],
"tsConfigPath": "src/tsconfig.renderer.json",
"skipCodeGeneration": true
"skipCodeGeneration": !process.env.AOT_BUILD
})
],
"node": {