-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make "resolve" external, fixes pnp (#165)
* fixes #163
- Loading branch information
1 parent
7c13ff4
commit d22269d
Showing
10 changed files
with
856 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/.yarn/cache | ||
/.yarn/install-state.gz | ||
/.yarn/unplugged | ||
/yarn.lock | ||
/.pnp.* | ||
/assets-plugin-tarball.tgz |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarnPath: .yarn/releases/yarn-3.2.1.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
sumPath: require.resolve('lodash/sum') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"build": "rm -rf dist && webpack", | ||
"test": "node test.js" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@vercel/webpack-asset-relocator-loader": "file:./assets-plugin-tarball.tgz", | ||
"webpack": "^5", | ||
"webpack-cli": "^4" | ||
}, | ||
"packageManager": "yarn@3.2.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const sumFilePath = path.resolve(__dirname, './dist/assets/sum.js'); | ||
|
||
|
||
assert.equal(fs.existsSync(sumFilePath), true) | ||
assert.equal(require('./dist/main').sumPath, sumFilePath) | ||
|
||
console.log('pnp test succeed!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = { | ||
target: 'node', | ||
mode: 'production', | ||
entry: { | ||
main: './main.js' | ||
}, | ||
output: { | ||
path: __dirname + '/dist', | ||
libraryTarget: 'commonjs' | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.m?js$/, | ||
parser: { amd: false }, | ||
use: { | ||
loader: require.resolve('@vercel/webpack-asset-relocator-loader'), | ||
options: { | ||
outputAssetBase: 'assets', | ||
} | ||
} | ||
}] | ||
} | ||
}; |