mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +08:00
feat(webpack5): initial project files
This commit is contained in:

committed by
Nathan Walker

parent
13a525ddd9
commit
9f436695ad
8
.gitignore
vendored
8
.gitignore
vendored
@ -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
|
||||
|
1
packages/webpack5/.gitignore
vendored
Normal file
1
packages/webpack5/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
#
|
13
packages/webpack5/package.json
Normal file
13
packages/webpack5/package.json
Normal 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"
|
||||
}
|
||||
}
|
8
packages/webpack5/src/configuration/angular.ts
Normal file
8
packages/webpack5/src/configuration/angular.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import base from './base';
|
||||
|
||||
// todo: add base configuration for angular
|
||||
export default function (env) {
|
||||
const config = base(env);
|
||||
|
||||
return {};
|
||||
}
|
6
packages/webpack5/src/configuration/base.ts
Normal file
6
packages/webpack5/src/configuration/base.ts
Normal 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 {};
|
||||
}
|
7
packages/webpack5/src/configuration/index.ts
Normal file
7
packages/webpack5/src/configuration/index.ts
Normal 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';
|
8
packages/webpack5/src/configuration/javascript.ts
Normal file
8
packages/webpack5/src/configuration/javascript.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import base from './base';
|
||||
|
||||
// todo: add base configuration for core
|
||||
export default function (env) {
|
||||
const config = base(env);
|
||||
|
||||
return {};
|
||||
}
|
8
packages/webpack5/src/configuration/react.ts
Normal file
8
packages/webpack5/src/configuration/react.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import base from './base';
|
||||
|
||||
// todo: add base configuration for react
|
||||
export default function (env) {
|
||||
const config = base(env);
|
||||
|
||||
return {};
|
||||
}
|
8
packages/webpack5/src/configuration/svelte.ts
Normal file
8
packages/webpack5/src/configuration/svelte.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import base from './base';
|
||||
|
||||
// todo: add base configuration for svelte
|
||||
export default function (env) {
|
||||
const config = base(env);
|
||||
|
||||
return {};
|
||||
}
|
8
packages/webpack5/src/configuration/typescript.ts
Normal file
8
packages/webpack5/src/configuration/typescript.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import base from './base';
|
||||
|
||||
// todo: add base configuration for core
|
||||
export default function (env) {
|
||||
const config = base(env);
|
||||
|
||||
return {};
|
||||
}
|
15
packages/webpack5/src/configuration/vue.ts
Normal file
15
packages/webpack5/src/configuration/vue.ts
Normal 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 {};
|
||||
}
|
1
packages/webpack5/src/index.ts
Normal file
1
packages/webpack5/src/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './configuration';
|
1
packages/webpack5/src/loaders/css2json-loader/index.ts
Normal file
1
packages/webpack5/src/loaders/css2json-loader/index.ts
Normal file
@ -0,0 +1 @@
|
||||
//
|
1
packages/webpack5/src/transformers/AngularHMR/index.ts
Normal file
1
packages/webpack5/src/transformers/AngularHMR/index.ts
Normal file
@ -0,0 +1 @@
|
||||
// todo
|
1
packages/webpack5/src/transformers/NativeClass/index.ts
Normal file
1
packages/webpack5/src/transformers/NativeClass/index.ts
Normal file
@ -0,0 +1 @@
|
||||
// todo
|
19
packages/webpack5/tsconfig.json
Normal file
19
packages/webpack5/tsconfig.json
Normal 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",
|
||||
]
|
||||
}
|
@ -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'
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -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": {
|
||||
|
Reference in New Issue
Block a user