mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
chore: add mode and build script
This commit is contained in:
1
packages/webpack5/.gitignore
vendored
1
packages/webpack5/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
#
|
#
|
||||||
|
dist
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
exports[`vue configuration for android 1`] = `
|
exports[`vue configuration for android 1`] = `
|
||||||
"{
|
"{
|
||||||
|
mode: 'development',
|
||||||
resolve: {
|
resolve: {
|
||||||
symlinks: true,
|
symlinks: true,
|
||||||
alias: {
|
alias: {
|
||||||
@ -137,6 +138,7 @@ exports[`vue configuration for android 1`] = `
|
|||||||
|
|
||||||
exports[`vue configuration for ios 1`] = `
|
exports[`vue configuration for ios 1`] = `
|
||||||
"{
|
"{
|
||||||
|
mode: 'development',
|
||||||
resolve: {
|
resolve: {
|
||||||
symlinks: true,
|
symlinks: true,
|
||||||
alias: {
|
alias: {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "echo todo",
|
"build": "tsc",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -10,6 +10,13 @@ export default function (env: IWebpackEnv): Config {
|
|||||||
const config = new Config();
|
const config = new Config();
|
||||||
const distPath = getDistPath(env);
|
const distPath = getDistPath(env);
|
||||||
const platform = determinePlatformFromEnv(env);
|
const platform = determinePlatformFromEnv(env);
|
||||||
|
const mode = env.production ? 'production' : 'development';
|
||||||
|
|
||||||
|
// set mode
|
||||||
|
config.mode(mode);
|
||||||
|
|
||||||
|
// todo: devtool
|
||||||
|
// config.devtool()
|
||||||
|
|
||||||
// look for loaders in
|
// look for loaders in
|
||||||
// - @nativescript/webpack/loaders
|
// - @nativescript/webpack/loaders
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"target": "es2015",
|
"target": "es2017",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
"outDir": "./dist",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
|
Reference in New Issue
Block a user