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' )
12const path = require ( 'path' )
23
34module . 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+
424 const libName = (
525 name ||
626 api . service . pkg . name ||
727 path . basename ( entry ) . replace ( / \. ( j s x ? | v u e ) $ / , '' )
828 )
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
1329
1430 function genConfig ( format , postfix = format , genHTML ) {
1531 const config = api . resolveChainableWebpackConfig ( )
You can’t perform that action at this time.
0 commit comments