Skip to content

Commit

Permalink
Add support of PnP
Browse files Browse the repository at this point in the history
  • Loading branch information
constgen committed Mar 16, 2021
1 parent 8b4d226 commit 878421d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let pug = require('./middlewares/pug-loader');

module.exports = function (customSettings = {}) {
return function (neutrino) {
let projectNodeModulesPath = path.resolve(process.cwd(), 'node_modules');
let projectPath = process.cwd();
let faviconPath = path.resolve(neutrino.options.source, 'favicon.ico');
let faviconExists = fs.existsSync(faviconPath);
let { name, version } = neutrino.options.packageJson;
Expand Down Expand Up @@ -118,10 +118,10 @@ module.exports = function (customSettings = {}) {
.end()
.resolve
.alias
.set('@', path.resolve(process.cwd(), 'src'))
.set('vue$', path.resolve(path.join(projectNodeModulesPath, 'vue/dist/vue.runtime.esm.js')))
.set('@', path.resolve(projectPath, 'src'))
.set('vue$', require.resolve('vue/dist/vue.runtime.esm.js', { paths: [projectPath] }))
.when(settings.compiler, function (alias) {
alias.set('vue$', path.resolve(path.join(projectNodeModulesPath, 'vue/dist/vue.esm.js')));
alias.set('vue$', require.resolve('vue/dist/vue.esm.js', { paths: [projectPath] }));
})
.end()
.end()
Expand Down

0 comments on commit 878421d

Please sign in to comment.