Skip to content

Commit 6430fbe

Browse files
i.frolkini.frolkin
authored andcommitted
Merge branch 'release/v7.0.0'
# Conflicts: # package.json
2 parents e56c3c5 + a83efb8 commit 6430fbe

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

‎lib/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function buildConfig(variant: string) {
3737
projectRoot: args[1],
3838
options: args[args.length - 1]
3939
};
40-
return interceptor(config, ...args);
40+
return interceptor(config, options);
4141
} catch (e) {
4242
console.dir(e);
4343
if (e.code === 'MODULE_NOT_FOUND') {

‎lib/set-up.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import * as fs from 'fs';
22

33
let packageJsonFile;
4+
let tsConfigFile;
45
try {
56
packageJsonFile = fs.readFileSync('package.json', 'utf-8');
7+
tsConfigFile = fs.readFileSync('tsconfig.json', 'utf-8');
68
} catch (e) {
7-
throw new Error('Cannot find package.json in the execution folder');
9+
throw new Error('Cannot find package.json or tsconfig.json in the execution folder');
810
}
911
const packageJson = JSON.parse(packageJsonFile.replace(/^\uFEFF/, ''));
1012
Object.keys(packageJson.scripts)
@@ -14,6 +16,11 @@ Object.keys(packageJson.scripts)
1416
'ngw ' + packageJson.scripts[x].slice(3) :
1517
packageJson.scripts[x];
1618
});
19+
20+
const tsConfig = JSON.parse(tsConfigFile.replace(/^\uFEFF/, ''));
21+
tsConfig.compilerOptions.module = 'commonjs';
22+
1723
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2) + '\n');
24+
fs.writeFileSync('tsconfig.json', JSON.stringify(tsConfig, null, 2) + '\n');
1825
fs.writeFileSync('ngw.config.ts', fs.readFileSync((require.resolve('../static/ngw.config.ts'))));
1926
console.log('Set up went successfully!');

‎package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngw",
3-
"version": "6.1.0",
3+
"version": "7.0.0",
44
"description": "Provides an opportunity to overload webpack config for angular-cli applications",
55
"main": "lib/index.js",
66
"typings": "lib/index",
@@ -27,10 +27,10 @@
2727
"peerDependencies": {
2828
"@types/node": "*",
2929
"@types/webpack": "*",
30-
"typescript": "^2.0.0"
30+
"typescript": "^3.0.0"
3131
},
3232
"dependencies": {
33-
"ts-node": "^5.0.0"
33+
"ts-node": "^7.0.1"
3434
},
3535
"devDependencies": {
3636
"@angular-devkit/build-angular": "0.6.7",

‎static/ngw.config.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import * as webpack from 'webpack';
22
import { Path } from '@angular-devkit/core';
33
import { NormalizedBrowserBuilderSchema } from '@angular-devkit/build-angular';
44

5-
export type WebpackOptions<T = NormalizedBrowserBuilderSchema> = {
6-
root: Path,
7-
projectRoot: Path,
5+
export interface WebpackOptions<T = NormalizedBrowserBuilderSchema> {
6+
root: Path;
7+
projectRoot: Path;
88
options: T;
9-
};
9+
}
1010

1111
const command = process.argv[2].toLowerCase();
1212

0 commit comments

Comments
 (0)