Skip to content

Commit 15f604a

Browse files
committed
build: update lintfile, project and webpack config
1 parent 9d80040 commit 15f604a

File tree

6 files changed

+49
-45
lines changed

6 files changed

+49
-45
lines changed

packages/client/.eslintrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"overrides": [
55
{
66
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7-
"parserOptions": {
8-
"project": ["packages/client/tsconfig.*?.json"]
9-
},
107
"rules": {}
118
},
129
{
1310
"files": ["*.ts", "*.tsx"],
11+
"parserOptions": {
12+
"project": ["packages/client/tsconfig.*?.json"]
13+
},
1414
"rules": {}
1515
},
1616
{

packages/client/project.json

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,22 @@
88
"build": {
99
"executor": "@nrwl/webpack:webpack",
1010
"outputs": ["{options.outputPath}"],
11-
"defaultConfiguration": "production",
11+
"defaultConfiguration": "development",
1212
"options": {
1313
"outputPath": "dist/packages/client",
1414
"compiler": "babel",
1515
"main": "packages/client/src/main.ts",
1616
"tsConfig": "packages/client/tsconfig.app.json",
17-
"webpackConfig": "packages/client/webpack.config.js",
18-
"assets": [
19-
"packages/client/src/favicon.ico",
20-
"packages/client/src/assets"
21-
],
22-
"index": "packages/client/src/index.html",
23-
"baseHref": "/",
24-
"styles": ["packages/client/src/styles.scss"],
25-
"scripts": []
17+
"webpackConfig": "packages/client/webpack.config.js"
2618
},
2719
"configurations": {
20+
"development": {},
2821
"production": {
2922
"optimization": true,
30-
"outputHashing": "all",
31-
"sourceMap": false,
23+
"outputHashing": "media",
3224
"namedChunks": false,
3325
"extractLicenses": true,
34-
"vendorChunk": false,
35-
"fileReplacements": [
36-
{
37-
"replace": "packages/client/src/environments/environment.ts",
38-
"with": "packages/client/src/environments/environment.prod.ts"
39-
}
40-
]
26+
"vendorChunk": false
4127
}
4228
}
4329
},

packages/client/webpack.config.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
const { composePlugins, withNx, withWeb } = require('@nrwl/webpack');
22

3+
const withDefaults = require('../../shared.webpack.config');
4+
const path = require('path');
5+
36
// Nx plugins for webpack.
47
module.exports = composePlugins(withNx(), withWeb(), (config) => {
58
// Update the webpack config as needed here.
69
// e.g. `config.plugins.push(new MyPlugin())`
7-
return config;
10+
const /**@type WebpackConfig*/ merged = withDefaults(
11+
/**@type WebpackConfig*/ config
12+
);
13+
14+
merged.context = path.join(__dirname);
15+
merged.entry = {
16+
extension: './src/extension.ts',
17+
};
18+
merged.output = {
19+
filename: 'extension.js',
20+
path: path.join(__dirname, 'out'),
21+
};
22+
23+
return merged;
824
});

packages/server/.eslintrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"overrides": [
55
{
66
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7-
"parserOptions": {
8-
"project": ["packages/server/tsconfig.*?.json"]
9-
},
107
"rules": {}
118
},
129
{
1310
"files": ["*.ts", "*.tsx"],
11+
"parserOptions": {
12+
"project": ["packages/server/tsconfig.*?.json"]
13+
},
1414
"rules": {}
1515
},
1616
{

packages/server/project.json

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,16 @@
1414
"compiler": "babel",
1515
"main": "packages/server/src/main.ts",
1616
"tsConfig": "packages/server/tsconfig.app.json",
17-
"webpackConfig": "packages/server/webpack.config.js",
18-
"assets": [
19-
"packages/server/src/favicon.ico",
20-
"packages/server/src/assets"
21-
],
22-
"index": "packages/server/src/index.html",
23-
"baseHref": "/",
24-
"styles": ["packages/server/src/styles.scss"],
25-
"scripts": []
17+
"webpackConfig": "packages/server/webpack.config.js"
2618
},
2719
"configurations": {
20+
"development": {},
2821
"production": {
2922
"optimization": true,
30-
"outputHashing": "all",
31-
"sourceMap": false,
23+
"outputHashing": "media",
3224
"namedChunks": false,
3325
"extractLicenses": true,
34-
"vendorChunk": false,
35-
"fileReplacements": [
36-
{
37-
"replace": "packages/server/src/environments/environment.ts",
38-
"with": "packages/server/src/environments/environment.prod.ts"
39-
}
40-
]
26+
"vendorChunk": false
4127
}
4228
}
4329
},

packages/server/webpack.config.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
const { composePlugins, withNx, withWeb } = require('@nrwl/webpack');
22

3+
const withDefaults = require('../../shared.webpack.config');
4+
const path = require('path');
5+
36
// Nx plugins for webpack.
47
module.exports = composePlugins(withNx(), withWeb(), (config) => {
58
// Update the webpack config as needed here.
69
// e.g. `config.plugins.push(new MyPlugin())`
7-
return config;
10+
const /**@type WebpackConfig*/ merged = withDefaults(
11+
/**@type WebpackConfig*/ config
12+
);
13+
14+
merged.context = path.join(__dirname);
15+
merged.entry = {
16+
extension: './src/sampleServer.ts',
17+
};
18+
merged.output = {
19+
filename: 'sampleServer.js',
20+
path: path.join(__dirname, 'out'),
21+
};
22+
23+
return merged;
824
});

0 commit comments

Comments
 (0)