Skip to content

Commit

Permalink
add $ to signify exact match
Browse files Browse the repository at this point in the history
credits to Nicol貌
  • Loading branch information
JLHwung committed Nov 13, 2019
1 parent 39b9ace commit a7d6bf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions packages/babel-core/package.json
Expand Up @@ -3,7 +3,6 @@
"version": "7.7.2",
"description": "Babel compiler core.",
"main": "lib/index.js",
"_main:used-by-babel-standalone": "src/index.js",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
Expand Down Expand Up @@ -31,9 +30,7 @@
},
"browser": {
"./lib/config/files/index.js": "./lib/config/files/index-browser.js",
"./lib/transform-file.js": "./lib/transform-file-browser.js"
},
"_browser:used-by-babel-standalone": {
"./lib/transform-file.js": "./lib/transform-file-browser.js",
"./src/config/files/index.js": "./src/config/files/index-browser.js",
"./src/transform-file.js": "./src/transform-file-browser.js"
},
Expand Down
7 changes: 1 addition & 6 deletions scripts/gulp-tasks.js
Expand Up @@ -29,10 +29,7 @@ function generateResolveAlias() {
const alias = {};
const packagePath = path.resolve(process.cwd(), "packages");
fs.readdirSync(packagePath).forEach(folder => {
if (["babel-core"].includes(folder)) {
return;
}
alias[folder.replace("babel-", "@babel/")] = path.resolve(
alias[folder.replace("babel-", "@babel/") + "$"] = path.resolve(
packagePath,
folder,
"src"
Expand Down Expand Up @@ -100,8 +97,6 @@ function webpackBuild(opts) {
resolve: {
//todo: remove resolve.alias when babel packages offer ESModule entry
alias: generateResolveAlias(),
aliasFields: ["_browser:used-by-babel-standalone", "browser"],
mainFields: ["_main:used-by-babel-standalone", "main"],
plugins: [
// Dedupe packages that are used across multiple plugins.
// This replaces DedupePlugin from Webpack 1.x
Expand Down

0 comments on commit a7d6bf4

Please sign in to comment.