Skip to content

Commit

Permalink
compile bundle with exports, expose as lru-cache/browser
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 22, 2022
1 parent 76b058f commit 9d5bd43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cache"
],
"scripts": {
"prepare": "webpack-cli -o bundle ./index.js",
"prepare": "webpack-cli -o bundle ./index.js --node-env production",
"build": "npm run prepare",
"presize": "npm run prepare",
"test": "tap",
Expand All @@ -21,6 +21,10 @@
},
"main": "index.js",
"browser": "./bundle/main.js",
"exports": {
".": "./index.js",
"./browser": "./bundle/main.js"
},
"repository": "git://github.com/isaacs/node-lru-cache.git",
"devDependencies": {
"@size-limit/preset-small-lib": "^7.0.8",
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
output: {
library: {
type: 'commonjs2',
},
},
}

0 comments on commit 9d5bd43

Please sign in to comment.