Skip to content

Commit e6b8e71

Browse files
committed
cleanup
1 parent a4ac1ef commit e6b8e71

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

addon/ng2/models/webpack-build-common.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@ import * as CopyWebpackPlugin from 'copy-webpack-plugin';
33
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
44
import * as webpack from 'webpack';
55
import * as atl from 'awesome-typescript-loader';
6-
import { CliConfig } from './config';
76

87
import {findLazyModules} from './find-lazy-modules';
98

10-
export function getWebpackCommonConfig(projectRoot: string, sourceDir: string) {
11-
const sourceRoot = path.resolve(projectRoot, `./${sourceDir}`);
129

13-
let outputPath: string = path.resolve(projectRoot, outputDir);
10+
export function getWebpackCommonConfig(projectRoot: string, sourceDir: string, outputDir: string) {
11+
const sourceRoot = path.resolve(projectRoot, `./${sourceDir}`);
12+
const outputPath = path.resolve(projectRoot, outputDir);
1413
const lazyModules = findLazyModules(path.resolve(projectRoot, sourceDir));
1514

1615
return {
1716
devtool: 'source-map',
1817
resolve: {
1918
extensions: ['', '.ts', '.js'],
20-
root: path.resolve(projectRoot, `./${sourceDir}`)
19+
root: sourceRoot
2120
},
2221
context: path.resolve(__dirname, './'),
2322
entry: {
@@ -37,7 +36,7 @@ export function getWebpackCommonConfig(projectRoot: string, sourceDir: string) {
3736
loader: 'awesome-typescript-loader',
3837
query: {
3938
useForkChecker: true,
40-
tsconfig: path.resolve(projectRoot, `./${sourceDir}/tsconfig.json`)
39+
tsconfig: path.resolve(sourceRoot, `tsconfig.json`)
4140
}
4241
}, {
4342
loader: 'angular2-template-loader'
@@ -58,7 +57,7 @@ export function getWebpackCommonConfig(projectRoot: string, sourceDir: string) {
5857
new webpack.ContextReplacementPlugin(/.*/, sourceRoot, lazyModules),
5958
new atl.ForkCheckerPlugin(),
6059
new HtmlWebpackPlugin({
61-
template: path.resolve(projectRoot, `./${sourceDir}/index.html`),
60+
template: path.resolve(sourceDir, `/index.html`),
6261
chunksSortMode: 'dependency'
6362
}),
6463
new webpack.optimize.CommonsChunkPlugin({

0 commit comments

Comments
 (0)