Skip to content
This repository was archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
fix: properly add pnp plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 9, 2019
1 parent 7d24b6d commit fdcd9e7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
23 changes: 15 additions & 8 deletions core/poi/lib/plugins/config-yarn-pnp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ exports.when = api =>

exports.apply = api => {
api.hook('createWebpackChain', config => {
const PnpWebpackPlugin = require('@poi/pnp-webpack-plugin')
const { apply, moduleLoader } = require('@poi/pnp-webpack-plugin')

config.merge({
resolve: {
plugins: [PnpWebpackPlugin]
},
resolveLoader: {
plugins: [PnpWebpackPlugin.moduleLoader(module)]
config.resolve.plugin('pnp').use(
class PnpWebpackPlugin {
apply(...args) {
return apply(...args)
}
}
})
)

config.resolveLoader.plugin('pnp').use(
class PnpWebpackPlugin {
apply(...args) {
return moduleLoader(module).apply(...args)
}
}
)
})
}
6 changes: 3 additions & 3 deletions create-poi-app/generator/saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ module.exports = {
)
},
devDependencies: {
poi: '^12.0.0',
poi: '^12.4.2',
'@poi/plugin-karma': when(unit === 'karma', '^13.0.0'),
eslint: when(useEslint, '^5.9.0'),
'eslint-config-xo': when(linterConfig === 'xo', '^0.25.0'),
'@poi/plugin-eslint': when(useEslint, '^12.0.0'),
typescript: when(typeChecker === 'ts', '^3.2.1'),
'@poi/plugin-typescript': when(typeChecker === 'ts', '^12.0.0'),
'@poi/plugin-pwa': when(features.includes('pwa'), '^12.0.0'),
'@poi/plugin-typescript': when(typeChecker === 'ts', '^12.0.1'),
'@poi/plugin-pwa': when(features.includes('pwa'), '^12.0.2'),
'register-service-worker': when(
features.includes('pwa'),
'^1.5.2'
Expand Down

0 comments on commit fdcd9e7

Please sign in to comment.