Skip to content

Commit

Permalink
Fix rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
MelleD committed May 30, 2024
1 parent 8692077 commit 2a487f7
Show file tree
Hide file tree
Showing 7 changed files with 305 additions and 629 deletions.
225 changes: 27 additions & 198 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prettier": "^3.2.5",
"rollup": "^4.18.0",
"rollup-plugin-serve": "^1.1.1",
"rollup-plugin-typescript2": "^0.36.0",
"@rollup/plugin-typescript": "^11.1.6",
"typescript": "^5.4.5"
},
"resolutions": {
Expand All @@ -60,6 +60,6 @@
"start": "rollup -c rollup.config.dev.mjs --watch",
"build": "npm run lint && npm run rollup",
"lint": "eslint src/*.ts",
"rollup": "rollup -c"
"rollup": "rollup -c --bundleConfigAsCjs"
}
}
24 changes: 12 additions & 12 deletions rollup-plugins/ignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ export default function (userOptions = {}) {
const files = userOptions.files || [];

if (files.length === 0) {
return {
name: 'ignore',
};
return {
name: "ignore",
};
}

return {
name: 'ignore',
name: "ignore",

load(id) {
return files.some((toIgnorePath) => id.startsWith(toIgnorePath))
? {
code: '',
}
: null;
},
load(id) {
return files.some((toIgnorePath) => id.startsWith(toIgnorePath))
? {
code: "",
}
: null;
},
};
}
}
20 changes: 14 additions & 6 deletions rollup.config.dev.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import resolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import typescript from "@rollup/plugin-typescript";
import babel from 'rollup-plugin-babel';
import serve from 'rollup-plugin-serve';
import { terser } from 'rollup-plugin-terser';
import json from '@rollup/plugin-json';
import ignore from './rollup-plugins/ignore';
import { ignoreTextfieldFiles } from './elements/ignore/textfield';
import { ignoreSelectFiles } from './elements/ignore/select';
import { ignoreSwitchFiles } from './elements/ignore/switch';
import ignore from "./rollup-plugins/ignore.js";

const IGNORED_FILES = [
"@material/mwc-notched-outline/mwc-notched-outline.js",
"@material/mwc-ripple/mwc-ripple.js",
"@material/mwc-list/mwc-list.js",
"@material/mwc-list/mwc-list-item.js",
"@material/mwc-menu/mwc-menu.js",
"@material/mwc-menu/mwc-menu-surface.js",
"@material/mwc-icon/mwc-icon.js",
];


export default {
input: ['src/pm-index-card.ts'],
Expand All @@ -33,7 +41,7 @@ export default {
},
}),
ignore({
files: [...ignoreTextfieldFiles, ...ignoreSelectFiles, ...ignoreSwitchFiles].map((file) => require.resolve(file)),
files: IGNORED_FILES.map((file) => require.resolve(file)),
}),
],
};
Loading

0 comments on commit 2a487f7

Please sign in to comment.