Skip to content

Commit

Permalink
Merge pull request #155 from pustovalov/yarn-pnp
Browse files Browse the repository at this point in the history
@size-limit/webpack: add pnp support
  • Loading branch information
ai committed Jan 30, 2020
2 parents 0d92004 + 8a65fb1 commit 91a9dc5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 199 deletions.
12 changes: 12 additions & 0 deletions packages/size-limit/test/__snapshots__/run.test.js.snap
Expand Up @@ -40,6 +40,18 @@ exports[`shows debug 1`] = `
\\"optimization\\": {
\\"concatenateModules\\": true
},
\\"resolve\\": {
\\"plugins\\": [
{
\\"topLevelLoader\\": {}
}
]
},
\\"resolveLoader\\": {
\\"plugins\\": [
{}
]
},
\\"module\\": {
\\"rules\\": [
{
Expand Down
11 changes: 11 additions & 0 deletions packages/webpack/get-config.js
@@ -1,6 +1,7 @@
let { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
let escapeRegexp = require('escape-string-regexp')
let OptimizeCss = require('optimize-css-assets-webpack-plugin')
let PnpWebpackPlugin = require('pnp-webpack-plugin')

const STATIC =
/\.(eot|woff2?|ttf|otf|svg|png|jpe?g|gif|webp|mp4|mp3|ogg|pdf|html|ico|md)$/
Expand All @@ -17,6 +18,16 @@ module.exports = function getConfig (limitConfig, check, output) {
optimization: {
concatenateModules: !check.disableModuleConcatenation
},
resolve: {
plugins: [
PnpWebpackPlugin
]
},
resolveLoader: {
plugins: [
PnpWebpackPlugin.moduleLoader(module)
]
},
module: {
rules: [
{
Expand Down
1 change: 1 addition & 0 deletions packages/webpack/package.json
Expand Up @@ -22,6 +22,7 @@
"file-loader": "^5.0.2",
"nanoid": "^2.1.9",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"pnp-webpack-plugin": "^1.6.0",
"rimraf": "^3.0.0",
"size-limit": "3.0.0",
"style-loader": "^1.1.2",
Expand Down

0 comments on commit 91a9dc5

Please sign in to comment.