Skip to content

Commit

Permalink
fix(plugin-vue): compiler is null on rollup (#6566)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jan 20, 2022
1 parent 56d84fb commit b289b2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
reactivityTransform,
root: process.cwd(),
sourceMap: true,
compiler: null as any // to be set in configResolved
compiler: null as any // to be set in buildStart
}

// Temporal handling for 2.7 breaking change
Expand Down Expand Up @@ -135,15 +135,18 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
...options,
root: config.root,
sourceMap: config.command === 'build' ? !!config.build.sourcemap : true,
isProduction: config.isProduction,
compiler: options.compiler || resolveCompiler(config.root)
isProduction: config.isProduction
}
},

configureServer(server) {
options.devServer = server
},

buildStart() {
options.compiler = options.compiler || resolveCompiler(options.root)
},

async resolveId(id) {
// component export helper
if (id === EXPORT_HELPER_ID) {
Expand Down

0 comments on commit b289b2d

Please sign in to comment.