Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 10, 2024
1 parent 7a26af2 commit 4d1453c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"unpkg": "dist/csstree-validator.esm.js",
"jsdelivr": "dist/csstree-validator.esm.js",
"browser": {
"path": false,
"./cjs/version.cjs": "./dist/version.cjs",
"./lib/version.js": "./dist/version.js"
},
Expand Down
6 changes: 3 additions & 3 deletions scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const { version } = createRequire(import.meta.url)('../package.json');

async function build() {
const genModules = {
[path.resolve('lib/version.js')]: `export const version = "${version}";`,
[path.resolve('lib/version.cjs')]: `module.exports = "${version}";`
'version.js': `export const version = "${version}";`,
'version.cjs': `module.exports = "${version}";`
};
const genModulesFilter = new RegExp('(' + Object.keys(genModules).join('|').replace(/\./g, '\\.').replace(/\\/g, '\\\\') + ')$');
const genModulesFilter = new RegExp('lib[\\\\/](' + Object.keys(genModules).join('|').replace(/\./g, '\\.') + ')$');
const plugins = [{
name: 'replace',
setup({ onLoad }) {
Expand Down

0 comments on commit 4d1453c

Please # to comment.