Skip to content

Commit

Permalink
Fixes yarnpkg/pnp build
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Dec 6, 2019
1 parent 883be78 commit 1742ed1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/yarnpkg-pnp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"build:pnp:hook": "run pnpify webpack-cli --config webpack.config.hook.js",
"build:pnp": "run pnpify webpack-cli --config webpack.config.pkg.js",
"postpack": "find lib -mindepth 1 ! -path 'lib/hook.js' -exec rm -rf '{}' +",
"postpack": "rm -rf lib",
"prepack": "run build:pnp && run build:compile packages/yarnpkg-pnp --emitDeclarationOnly --declaration",
"release": "yarn npm publish",
"update-local": "run build:pnp:hook"
Expand Down
5 changes: 2 additions & 3 deletions packages/yarnpkg-pnp/sources/generatePnpScript.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// @ts-ignore
import template from '@yarnpkg/pnp/lib/hook';

import {generatePrettyJson} from './generatePrettyJson';
import {generateSerializedState} from './generateSerializedState';
// @ts-ignore
import template from './hook';
import {SerializedState} from './types';
import {PnpSettings} from './types';

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions packages/yarnpkg-pnp/webpack.config.hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = makeConfig({

mode: 'production',
optimization: {
minimize: false
minimize: false,
},

entry: {
Expand All @@ -15,14 +15,14 @@ module.exports = makeConfig({

output: {
filename: `[name].js`,
path: `${__dirname}/lib`,
path: `${__dirname}/sources`,
libraryExport: `default`,
libraryTarget: `umd`,
library: `pnpHook`,
},

plugins: [
{ apply: compiler => {
{apply: compiler => {
compiler.hooks.compilation.tap(`MyPlugin`, compilation => {
compilation.hooks.optimizeChunkAssets.tap(`MyPlugin`, chunks => {
for (const chunk of chunks) {
Expand All @@ -34,6 +34,6 @@ module.exports = makeConfig({
}
});
});
} },
}},
],
});
2 changes: 1 addition & 1 deletion packages/yarnpkg-pnp/webpack.config.pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = makeConfig({

mode: `production`,
optimization: {
minimize: false
minimize: false,
},

entry: {
Expand Down

0 comments on commit 1742ed1

Please sign in to comment.