From ea8c2a6505fcba2f724bcba4d4e21bdf9c6d9803 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 3 Oct 2018 19:50:22 +0100 Subject: [PATCH] feat: move build to packages (#4031) * feat: move build to packages * fix: remove build in eslint * refactor: rename nuxt-build to nuxt-pack --- package.json | 4 ++-- packages/nuxt-legacy/package.json | 2 +- packages/nuxt-legacy/rollup.config.js | 2 +- {build => packages/nuxt-pack}/build.js | 2 +- {build => packages/nuxt-pack}/builtins.js | 0 {build => packages/nuxt-pack}/package.js | 0 {build => packages/nuxt-pack}/rollup.config.js | 0 packages/nuxt-start/package.json | 2 +- packages/nuxt-start/rollup.config.js | 2 +- rollup.config.js | 2 +- 10 files changed, 8 insertions(+), 8 deletions(-) rename {build => packages/nuxt-pack}/build.js (88%) rename {build => packages/nuxt-pack}/builtins.js (100%) rename {build => packages/nuxt-pack}/package.js (100%) rename {build => packages/nuxt-pack}/rollup.config.js (100%) diff --git a/package.json b/package.json index 49ca2eb9af..9ade447214 100644 --- a/package.json +++ b/package.json @@ -54,9 +54,9 @@ "nuxt": "./bin/nuxt" }, "scripts": { - "build": "node -r esm ./build/build.js", + "build": "node -r esm ./packages/nuxt-pack/build.js", "coverage": "codecov", - "lint": "eslint --ext .js,.mjs,.vue bin/** benchmarks build examples lib packages test", + "lint": "eslint --ext .js,.mjs,.vue bin/** benchmarks examples lib packages test", "postinstall": "opencollective || exit 0", "test": "yarn test:fixtures && yarn test:unit", "test:fixtures": "jest test/fixtures", diff --git a/packages/nuxt-legacy/package.json b/packages/nuxt-legacy/package.json index 7040b65acd..a6f5ad5045 100644 --- a/packages/nuxt-legacy/package.json +++ b/packages/nuxt-legacy/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-legacy", - "version": "2.0.0", + "version": "2.1.0", "description": "Legacy build of Nuxt.js for Node.js < 8.0.0", "license": "MIT", "homepage": "https://github.com/nuxt/nuxt.js#readme", diff --git a/packages/nuxt-legacy/rollup.config.js b/packages/nuxt-legacy/rollup.config.js index 41efa96a36..41cc083429 100644 --- a/packages/nuxt-legacy/rollup.config.js +++ b/packages/nuxt-legacy/rollup.config.js @@ -1,5 +1,5 @@ import babel from 'rollup-plugin-babel' -import config from '../../build/rollup.config' +import config from '../nuxt-pack/rollup.config' export default config({ rootDir: __dirname, diff --git a/build/build.js b/packages/nuxt-pack/build.js similarity index 88% rename from build/build.js rename to packages/nuxt-pack/build.js index d453857bb0..051951d444 100644 --- a/build/build.js +++ b/packages/nuxt-pack/build.js @@ -2,7 +2,7 @@ import path from 'path' import Package from './package' // Commons -const rootDir = path.resolve(__dirname, '..') +const rootDir = path.resolve(__dirname, '..', '..') // Force NODE_ENV to production process.env.NODE_ENV = 'production' diff --git a/build/builtins.js b/packages/nuxt-pack/builtins.js similarity index 100% rename from build/builtins.js rename to packages/nuxt-pack/builtins.js diff --git a/build/package.js b/packages/nuxt-pack/package.js similarity index 100% rename from build/package.js rename to packages/nuxt-pack/package.js diff --git a/build/rollup.config.js b/packages/nuxt-pack/rollup.config.js similarity index 100% rename from build/rollup.config.js rename to packages/nuxt-pack/rollup.config.js diff --git a/packages/nuxt-start/package.json b/packages/nuxt-start/package.json index 0b7267de74..fb0a99f633 100644 --- a/packages/nuxt-start/package.json +++ b/packages/nuxt-start/package.json @@ -1,6 +1,6 @@ { "name": "nuxt-start", - "version": "2.0.0", + "version": "2.1.0", "description": "Starts Nuxt.js Application in production mode", "license": "MIT", "homepage": "https://github.com/nuxt/nuxt.js#readme", diff --git a/packages/nuxt-start/rollup.config.js b/packages/nuxt-start/rollup.config.js index 683be99690..a2de565543 100644 --- a/packages/nuxt-start/rollup.config.js +++ b/packages/nuxt-start/rollup.config.js @@ -1,4 +1,4 @@ -import config from '../../build/rollup.config' +import config from '../nuxt-pack/rollup.config' export default config({ rootDir: __dirname diff --git a/rollup.config.js b/rollup.config.js index 54d92332af..918f1781e7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,4 @@ -import config from './build/rollup.config' +import config from './packages/nuxt-pack/rollup.config' export default config({ rootDir: __dirname,