Skip to content

Commit 4d1453c

Browse files
committed
Refactor
1 parent 7a26af2 commit 4d1453c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"unpkg": "dist/csstree-validator.esm.js",
2828
"jsdelivr": "dist/csstree-validator.esm.js",
2929
"browser": {
30-
"path": false,
3130
"./cjs/version.cjs": "./dist/version.cjs",
3231
"./lib/version.js": "./dist/version.js"
3332
},

scripts/bundle.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ const { version } = createRequire(import.meta.url)('../package.json');
77

88
async function build() {
99
const genModules = {
10-
[path.resolve('lib/version.js')]: `export const version = "${version}";`,
11-
[path.resolve('lib/version.cjs')]: `module.exports = "${version}";`
10+
'version.js': `export const version = "${version}";`,
11+
'version.cjs': `module.exports = "${version}";`
1212
};
13-
const genModulesFilter = new RegExp('(' + Object.keys(genModules).join('|').replace(/\./g, '\\.').replace(/\\/g, '\\\\') + ')$');
13+
const genModulesFilter = new RegExp('lib[\\\\/](' + Object.keys(genModules).join('|').replace(/\./g, '\\.') + ')$');
1414
const plugins = [{
1515
name: 'replace',
1616
setup({ onLoad }) {

0 commit comments

Comments
 (0)