forked from vuejs/vuex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update the build system to the latest structure (vuejs#1729)
* build: update the build system to the latest structure * build: use __DEV__ global * chore: ignore all `node_modules` folder * build: tweek some bundle settings
- Loading branch information
Showing
28 changed files
with
511 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,8 @@ | |
"root": true, | ||
"extends": [ | ||
"plugin:vue-libs/recommended" | ||
] | ||
], | ||
"globals": { | ||
"__DEV__": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
/docs/.vuepress/dist | ||
/examples/**/build.js | ||
/test/e2e/reports | ||
/test/e2e/screenshots | ||
/types/typings | ||
/types/test/*.js | ||
*.log | ||
.DS_Store | ||
node_modules | ||
TODO.md | ||
lib | ||
docs/.vuepress/dist | ||
examples/**/build.js | ||
types/typings | ||
types/test/*.js | ||
explorations | ||
*.log | ||
test/e2e/reports | ||
test/e2e/screenshots |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import buble from '@rollup/plugin-buble' | ||
import replace from '@rollup/plugin-replace' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import { terser } from 'rollup-plugin-terser' | ||
import pkg from './package.json' | ||
|
||
const banner = `/*! | ||
* vuex v${pkg.version} | ||
* (c) ${new Date().getFullYear()} Evan You | ||
* @license MIT | ||
*/` | ||
|
||
export function createEntries(configs) { | ||
return configs.map((c) => createEntry(c)) | ||
} | ||
|
||
function createEntry(config) { | ||
const c = { | ||
input: config.input, | ||
plugins: [], | ||
output: { | ||
banner, | ||
file: config.file, | ||
format: config.format | ||
}, | ||
onwarn: (msg, warn) => { | ||
if (!/Circular/.test(msg)) { | ||
warn(msg) | ||
} | ||
} | ||
} | ||
|
||
if (config.format === 'umd') { | ||
c.output.name = c.output.name || 'Vuex' | ||
} | ||
|
||
c.plugins.push(replace({ | ||
__VERSION__: pkg.version, | ||
__DEV__: config.format !== 'umd' && !config.browser | ||
? `(process.env.NODE_ENV !== 'production')` | ||
: config.env !== 'production' | ||
})) | ||
|
||
if (config.transpile !== false) { | ||
c.plugins.push(buble()) | ||
} | ||
|
||
c.plugins.push(resolve()) | ||
c.plugins.push(commonjs()) | ||
|
||
if (config.minify) { | ||
c.plugins.push(terser({ module: config.format === 'es' })) | ||
} | ||
|
||
return c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createEntries } from './rollup.config' | ||
|
||
export default createEntries([ | ||
{ input: 'src/plugins/logger.js', file: 'dist/logger.js', name: 'createVuexLogger', format: 'umd', env: 'development' } | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { createEntries } from './rollup.config' | ||
|
||
export default createEntries([ | ||
{ input: 'src/index.js', file: 'dist/vuex.esm.browser.js', format: 'es', browser: true, transpile: false, env: 'development' }, | ||
{ input: 'src/index.js', file: 'dist/vuex.esm.browser.min.js', format: 'es', browser: true, transpile: false, minify: true, env: 'production' }, | ||
{ input: 'src/index.js', file: 'dist/vuex.esm.js', format: 'es', env: 'development' }, | ||
{ input: 'src/index.cjs.js', file: 'dist/vuex.js', format: 'umd', env: 'development' }, | ||
{ input: 'src/index.cjs.js', file: 'dist/vuex.min.js', format: 'umd', minify: true, env: 'production' }, | ||
{ input: 'src/index.cjs.js', file: 'dist/vuex.common.js', format: 'cjs', env: 'development' } | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const { run } = require('./build') | ||
|
||
const files = ['dist/logger.js'] | ||
|
||
run('rollup.logger.config.js', files) |
Oops, something went wrong.