File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/@vue/cli-service Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ test('load project options from package.json', () => {
5353} )
5454
5555test ( 'load project options from vue.config.js' , ( ) => {
56+ process . env . VUE_CLI_SERVICE_CONFIG_PATH = `/vue.config.js`
5657 fs . writeFileSync ( '/vue.config.js' , `module.exports = { lintOnSave: false }` )
5758 mockPkg ( {
5859 vue : {
@@ -61,6 +62,7 @@ test('load project options from vue.config.js', () => {
6162 } )
6263 const service = createMockService ( )
6364 fs . unlinkSync ( '/vue.config.js' )
65+ delete process . env . VUE_CLI_SERVICE_CONFIG_PATH
6466 // vue.config.js has higher priority
6567 expect ( service . projectOptions . lintOnSave ) . toBe ( false )
6668} )
Original file line number Diff line number Diff line change @@ -159,11 +159,13 @@ module.exports = class Service {
159159 loadProjectOptions ( inlineOptions ) {
160160 // vue.config.js
161161 let fileConfig , pkgConfig , resolved , resovledFrom
162- const configPath = path . resolve ( this . context , 'vue.config.js' )
162+ const configPath = (
163+ process . env . VUE_CLI_SERVICE_CONFIG_PATH ||
164+ path . resolve ( this . context , 'vue.config.js' )
165+ )
163166 if ( fs . existsSync ( configPath ) ) {
164167 try {
165168 fileConfig = require ( configPath )
166- console . log ( fileConfig )
167169 if ( ! fileConfig || typeof fileConfig !== 'object' ) {
168170 error (
169171 `Error loading ${ chalk . bold ( 'vue.config.js' ) } : should export an object.`
You can’t perform that action at this time.
0 commit comments