FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

better handling --kind option · angular/angular-cli@f55954a · GitHub

Commit f55954a

Browse files
committed
better handling --kind option
1 parent da24412 commit f55954a

4 files changed

Lines changed: 30 additions & 13 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"svg-sprite-loader": "0.0.31",
128128
"temp": "0.8.3",
129129
"through": "^2.3.6",
130-
"ts-loader": "^0.8.2",
130+
"ts-loader": "1.2.2",
131131
"tslint": "^3.15.1",
132132
"tslint-loader": "^2.1.4",
133133
"typescript": "~2.0.3",

‎packages/angular-cli/blueprints/rt-component/index.js‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,22 @@ module.exports = {
108108
// Return custom template variables here.
109109
return {
110110
__path__: () => {
111-
return `src/app/ui/components/${options.locals.rtKind.toLowerCase().replace(' ','-')}/${options.dasherizedModuleName}`;
111+
var dir = this.dynamicPath.dir;
112+
if (!options.locals.flat) {
113+
dir += path.sep + options.dasherizedModuleName;
114+
}
115+
var srcDir = this.project.ngConfig.apps[0].root;
116+
var kindDirname = options.locals.rtKind.toLowerCase().replace(' ','-');
117+
var kindMatch = dir.match(/.*\/components\/ui\/(.*)\/.*$/);
118+
119+
this.appDir = dir.substr(dir.indexOf(srcDir) + srcDir.length);
120+
this.generatePath = dir;
121+
122+
if(kindMatch) {
123+
return dir;
124+
}
125+
126+
return `src/app/ui/components/${kindDirname}/${options.dasherizedModuleName}`
112127
},
113128
__styleext__: () => {
114129
return this.styleExt;

‎packages/angular-cli/models/webpack-build-production.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
2424
devtool: 'source-map',
2525
output: {
2626
path: path.resolve(projectRoot, appConfig.outDir),
27-
filename: '[name].[chunkhash].bundle.js',
28-
sourceMapFilename: '[name].[chunkhash].bundle.map',
29-
chunkFilename: '[id].[chunkhash].chunk.js'
27+
filename: '[name].[hash].bundle.js',
28+
sourceMapFilename: '[name].[hash].bundle.map',
29+
chunkFilename: '[id].[hash].chunk.js'
3030
},
3131
module: {
3232
rules: [
@@ -57,6 +57,7 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
5757
'process.env.NODE_ENV': JSON.stringify('production')
5858
}),
5959
new webpack.optimize.UglifyJsPlugin(<any>{
60+
warnings: false,
6061
mangle: { screw_ie8 : true },
6162
compress: { screw_ie8: true },
6263
sourceMap: true
@@ -72,8 +73,9 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
7273
options: {
7374
postcss: [
7475
require('postcss-discard-comments')
75-
]
76-
}
76+
],
77+
resolve: {}
78+
},
7779
})
7880
]
7981
};

‎packages/angular-cli/models/webpack-build-typescript.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const getWebpackNonAotConfigPartial = function(projectRoot: string, appCo
1919
resolve: {
2020
plugins: [
2121
new atl.TsConfigPathsPlugin({
22-
tsconfig: path.resolve(appRoot, appConfig.tsconfig)
22+
configFileName: path.resolve(appRoot, appConfig.tsconfig)
2323
})
2424
]
2525
},
@@ -30,21 +30,21 @@ export const getWebpackNonAotConfigPartial = function(projectRoot: string, appCo
3030
loaders: [{
3131
loader: '@angularclass/hmr-loader'
3232
},{
33-
loader: 'awesome-typescript-loader',
33+
loader: 'ts-loader',
3434
query: {
35-
forkChecker: true,
36-
tsconfig: path.resolve(appRoot, appConfig.tsconfig)
35+
configFileName: path.resolve(appRoot, appConfig.tsconfig),
36+
// transpileOnly: true
3737
}
3838
}, {
3939
loader: 'angular2-template-loader'
4040
}],
41-
exclude: [/\.(spec|e2e)\.ts$/]
41+
exclude: [/node_modules/, /\.(spec)\.ts$/]
4242
}
4343
],
4444
},
4545
plugins: [
4646
new webpack.ContextReplacementPlugin(/.*/, appRoot, lazyModules),
47-
new atl.ForkCheckerPlugin(),
47+
// new atl.ForkCheckerPlugin(),
4848
]
4949
};
5050
};

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL