From bb0e314291657d192e24cb6a377878b6cc740576 Mon Sep 17 00:00:00 2001 From: Jonathan Keslin Date: Fri, 23 Feb 2024 13:13:54 -0800 Subject: [PATCH] [WIP] Fix up rollup to use esm config --- elements/ignore/{select.js => select.mjs} | 0 elements/ignore/{switch.js => switch.mjs} | 0 elements/ignore/{textfield.js => textfield.mjs} | 0 package.json | 2 +- rollup-plugins/{ignore.js => ignore.mjs} | 0 rollup.config.dev.mjs | 11 +++++++---- rollup.config.mjs | 13 ++++++++----- 7 files changed, 16 insertions(+), 10 deletions(-) rename elements/ignore/{select.js => select.mjs} (100%) rename elements/ignore/{switch.js => switch.mjs} (100%) rename elements/ignore/{textfield.js => textfield.mjs} (100%) rename rollup-plugins/{ignore.js => ignore.mjs} (100%) diff --git a/elements/ignore/select.js b/elements/ignore/select.mjs similarity index 100% rename from elements/ignore/select.js rename to elements/ignore/select.mjs diff --git a/elements/ignore/switch.js b/elements/ignore/switch.mjs similarity index 100% rename from elements/ignore/switch.js rename to elements/ignore/switch.mjs diff --git a/elements/ignore/textfield.js b/elements/ignore/textfield.mjs similarity index 100% rename from elements/ignore/textfield.js rename to elements/ignore/textfield.mjs diff --git a/package.json b/package.json index 484a458f..777ec424 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "scripts": { "start": "npm run build:dev -- --watch", "build": "npm run lint && npm run rollup", - "build:dev": "rollup -c rollup.config.dev.js", + "build:dev": "rollup -c rollup.config.dev.mjs", "lint": "eslint src/*.ts", "rollup": "rollup -c", "test:server": "http-server ./ -c-1 -p 8000 -s", diff --git a/rollup-plugins/ignore.js b/rollup-plugins/ignore.mjs similarity index 100% rename from rollup-plugins/ignore.js rename to rollup-plugins/ignore.mjs diff --git a/rollup.config.dev.mjs b/rollup.config.dev.mjs index a18b3621..215495e8 100644 --- a/rollup.config.dev.mjs +++ b/rollup.config.dev.mjs @@ -10,10 +10,13 @@ import serve from 'rollup-plugin-serve'; import { terser } from 'rollup-plugin-terser'; import json from '@rollup/plugin-json'; import replace from '@rollup/plugin-replace'; -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.mjs'; +import * as ignoreTextfield from './elements/ignore/textfield.mjs'; +const { ignoreTextfieldFiles } = ignoreTextfield; +import * as ignoreSelect from './elements/ignore/select.mjs'; +const { ignoreSelectFiles } = ignoreSelect; +import * as ignoreSwitch from './elements/ignore/switch.mjs'; +const { ignoreSwitchFiles } = ignoreSwitch; import { defineConfig } from 'rollup'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/rollup.config.mjs b/rollup.config.mjs index ecb4c2ca..d185f045 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -10,11 +10,14 @@ import { terser } from 'rollup-plugin-terser'; import serve from 'rollup-plugin-serve'; import json from '@rollup/plugin-json'; import replace from '@rollup/plugin-replace'; -import visualizer from 'rollup-plugin-visualizer'; -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 { visualizer } from 'rollup-plugin-visualizer'; +import ignore from './rollup-plugins/ignore.mjs'; +import * as ignoreTextfield from './elements/ignore/textfield.mjs'; +const { ignoreTextfieldFiles } = ignoreTextfield; +import * as ignoreSelect from './elements/ignore/select.mjs'; +const { ignoreSelectFiles } = ignoreSelect; +import * as ignoreSwitch from './elements/ignore/switch.mjs'; +const { ignoreSwitchFiles } = ignoreSwitch; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const require = createRequire(import.meta.url);