feat(webpack5): initial project files

This commit is contained in:
Igor Randjelovic
2020-11-14 12:07:56 +01:00
committed by Nathan Walker
parent 13a525ddd9
commit 9f436695ad
19 changed files with 144 additions and 4 deletions

8
.gitignore vendored
View File

@ -6,10 +6,10 @@
/out-tsc
# dependencies
node_modules
package-lock.json
yarn.lock
pnpm-lock.yaml
**/node_modules
**/package-lock.json
**/yarn.lock
**/pnpm-lock.yaml
# IDEs and editors
.idea

View File

@ -42,6 +42,9 @@
},
"webpack": {
"tags": []
},
"webpack5": {
"tags": []
}
}
}

1
packages/webpack5/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
#

View File

@ -0,0 +1,13 @@
{
"name": "@nativescript/webpack",
"version": "4.0.0-dev",
"private": true,
"main": "index.js",
"license": "Apache-2.0",
"scripts": {
"build": "echo todo"
},
"devDependencies": {
"webpack": "^5.4.0"
}
}

View File

@ -0,0 +1,8 @@
import base from './base';
// todo: add base configuration for angular
export default function (env) {
const config = base(env);
return {};
}

View File

@ -0,0 +1,6 @@
import { Configuration } from 'webpack';
// todo: add base configuration that's shared across all flavors
export default function (env): Configuration {
return {};
}

View File

@ -0,0 +1,7 @@
export { default as angularConfig } from './angular';
export { default as baseConfig } from './base';
export { default as javascriptConfig } from './javascript';
export { default as reactConfig } from './react';
export { default as svelteConfig } from './svelte';
export { default as typescriptConfig } from './typescript';
export { default as vueConfig } from './vue';

View File

@ -0,0 +1,8 @@
import base from './base';
// todo: add base configuration for core
export default function (env) {
const config = base(env);
return {};
}

View File

@ -0,0 +1,8 @@
import base from './base';
// todo: add base configuration for react
export default function (env) {
const config = base(env);
return {};
}

View File

@ -0,0 +1,8 @@
import base from './base';
// todo: add base configuration for svelte
export default function (env) {
const config = base(env);
return {};
}

View File

@ -0,0 +1,8 @@
import base from './base';
// todo: add base configuration for core
export default function (env) {
const config = base(env);
return {};
}

View File

@ -0,0 +1,15 @@
import base from './base';
// todo: add base configuration for vue
export default function (env) {
const config = base(env);
// todo: we may want to use webpack-chain internally
// to avoid "trying to read property x of undefined" type of issues
config.module.rules.push({
test: /.vue$/,
use: [],
});
return {};
}

View File

@ -0,0 +1 @@
export * from './configuration';

View File

@ -0,0 +1 @@
//

View File

@ -0,0 +1 @@
// todo

View File

@ -0,0 +1 @@
// todo

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"target": "es2015",
"module": "commonjs",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2017" ],
"sourceMap": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"diagnostics": true
},
"exclude": [
"node_modules",
]
}

View File

@ -115,6 +115,13 @@ module.exports = {
test: {
script: 'nx run webpack:test',
description: '@nativescript/webpack: Unit tests'
},
},
// @nativescript/webpack (5)
webpack5: {
build: {
script: 'nx run webpack5:build',
description: '@nativescript/webpack(5): Build for npm'
},
},
},

View File

@ -253,6 +253,31 @@
}
}
}
},
"webpack5": {
"root": "packages/webpack5",
"sourceRoot": "packages/webpack5",
"projectType": "library",
"schematics": {},
"architect": {
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": []
}
},
"build": {
"builder": "@nrwl/workspace:run-commands",
"outputs": ["dist/packages"],
"options": {
"commands": [
"npm run build"
],
"cwd": "packages/webpack5",
"parallel": false
}
}
}
}
},
"cli": {