File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
packages/@vue/cli-service/lib/commands/build Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change
1
+ const fs = require ( 'fs' )
1
2
const path = require ( 'path' )
2
3
3
4
module . exports = ( api , { entry, name } , options ) => {
5
+ // setting this disables app-only configs
6
+ process . env . VUE_CLI_TARGET = 'lib'
7
+ // inline all static asset files since there is no publicPath handling
8
+ process . env . VUE_CLI_INLINE_LIMIT = Infinity
9
+
10
+ const { log, error } = require ( '@vue/cli-shared-utils' )
11
+ const abort = msg => {
12
+ log ( )
13
+ error ( msg )
14
+ process . exit ( 1 )
15
+ }
16
+
17
+ if ( ! fs . existsSync ( api . resolve ( entry ) ) ) {
18
+ abort (
19
+ `Failed to resolve lib entry: ${ entry } ${ entry === `src/App.vue` ? ' (default)' : '' } . ` +
20
+ `Make sure to specify the correct entry file.`
21
+ )
22
+ }
23
+
4
24
const libName = (
5
25
name ||
6
26
api . service . pkg . name ||
7
27
path . basename ( entry ) . replace ( / \. ( j s x ? | v u e ) $ / , '' )
8
28
)
9
- // setting this disables app-only configs
10
- process . env . VUE_CLI_TARGET = 'lib'
11
- // inline all static asset files since there is no publicPath handling
12
- process . env . VUE_CLI_INLINE_LIMIT = Infinity
13
29
14
30
function genConfig ( format , postfix = format , genHTML ) {
15
31
const config = api . resolveChainableWebpackConfig ( )
You can’t perform that action at this time.
0 commit comments