@@ -7,14 +7,13 @@ if (!process.env.TARGET) {
7
7
throw new Error ( 'TARGET package must be specified via --environment flag.' )
8
8
}
9
9
10
- const masterVersion =
11
- process . env . NEXT_VERSION || require ( './package.json' ) . version
12
10
const packagesDir = path . resolve ( __dirname , 'packages' )
13
11
const pkgDir = path . resolve ( packagesDir , process . env . TARGET )
14
12
const name = path . basename ( pkgDir )
15
13
const resolve = ( file ) => path . resolve ( pkgDir , file )
16
14
const pkg = require ( resolve ( `package.json` ) )
17
15
const packageOptions = pkg . buildOptions || { }
16
+ const masterVersion = process . env . NEXT_VERSION || pkg . version
18
17
19
18
// ensure TS checks only once for each build
20
19
let hasTSChecked = false
@@ -117,15 +116,15 @@ function createConfig(format, output, plugins = []) {
117
116
const nodePlugins =
118
117
format !== 'cjs'
119
118
? [
120
- require ( '@rollup/plugin-node-resolve' ) . nodeResolve ( {
121
- preferBuiltins : true ,
122
- } ) ,
123
- require ( '@rollup/plugin-commonjs' ) ( {
124
- sourceMap : false ,
125
- } ) ,
126
- require ( 'rollup-plugin-node-builtins' ) ( ) ,
127
- require ( 'rollup-plugin-node-globals' ) ( ) ,
128
- ]
119
+ require ( '@rollup/plugin-node-resolve' ) . nodeResolve ( {
120
+ preferBuiltins : true ,
121
+ } ) ,
122
+ require ( '@rollup/plugin-commonjs' ) ( {
123
+ sourceMap : false ,
124
+ } ) ,
125
+ require ( 'rollup-plugin-node-builtins' ) ( ) ,
126
+ require ( 'rollup-plugin-node-globals' ) ( ) ,
127
+ ]
129
128
: [ ]
130
129
131
130
const shouldEmitDeclarations = process . env . TYPES != null && ! hasTSChecked
@@ -197,9 +196,9 @@ function createReplacePlugin(
197
196
__VERSION__ : `"${ masterVersion } "` ,
198
197
__DEV__ : isBundlerESMBuild
199
198
? // preserve to be handled by bundlers
200
- `(process.env.NODE_ENV !== 'production')`
199
+ `(process.env.NODE_ENV !== 'production')`
201
200
: // hard coded dev/prod builds
202
- ! isProduction ,
201
+ ! isProduction ,
203
202
// this is only used during Vue's internal tests
204
203
__TEST__ : false ,
205
204
// If the build is expected to run directly in the browser (global / esm builds)
@@ -218,11 +217,11 @@ function createReplacePlugin(
218
217
: false ,
219
218
...( isProduction && isBrowserBuild
220
219
? {
221
- 'context.onError(' : `/*#__PURE__*/ context.onError(` ,
222
- 'emitError(' : `/*#__PURE__*/ emitError(` ,
223
- 'createCompilerError(' : `/*#__PURE__*/ createCompilerError(` ,
224
- 'createDOMCompilerError(' : `/*#__PURE__*/ createDOMCompilerError(` ,
225
- }
220
+ 'context.onError(' : `/*#__PURE__*/ context.onError(` ,
221
+ 'emitError(' : `/*#__PURE__*/ emitError(` ,
222
+ 'createCompilerError(' : `/*#__PURE__*/ createCompilerError(` ,
223
+ 'createDOMCompilerError(' : `/*#__PURE__*/ createDOMCompilerError(` ,
224
+ }
226
225
: { } ) ,
227
226
}
228
227
// allow inline overrides like
0 commit comments