Skip to content

Commit

Permalink
feat: move to type module
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdor committed Nov 28, 2023
1 parent ed7c165 commit 0941f68
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"corejs": "3.21"
}
]
],
"plugins": [
"@babel/plugin-syntax-import-assertions"
]
}
12 changes: 6 additions & 6 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { loadPlugin, HTMLClip } from "@donkeyclip/motorcortex";
import { HTMLClip, loadPlugin } from "@donkeyclip/motorcortex";
import Player from "@donkeyclip/motorcortex-player";
import MyPluginDefinition from "../dist/bundle.esm";
import MyPluginDefinition from "../dist/bundle.esm.js";
const MyPlugin = loadPlugin(MyPluginDefinition);

const clip = new HTMLClip({
Expand Down Expand Up @@ -36,7 +36,7 @@ const newEffect = new MyPlugin.MyEffect(
{
selector: "#effect",
duration: 1000,
}
},
);

const newCombo = new MyPlugin.MyCombo(
Expand All @@ -45,7 +45,7 @@ const newCombo = new MyPlugin.MyCombo(
},
{
selector: "#combo",
}
},
);

const newHTMLClip = new MyPlugin.MyHTMLClip(
Expand All @@ -54,7 +54,7 @@ const newHTMLClip = new MyPlugin.MyHTMLClip(
},
{
selector: "#htmlclip",
}
},
);

const newCustomClip = new MyPlugin.Clip({
Expand All @@ -66,4 +66,4 @@ clip.addIncident(newCombo, 0);
clip.addIncident(newHTMLClip, 0);
clip.addIncident(newCustomClip, 0);

const player = new Player({ clip });
new Player({ clip });
File renamed without changes.
1 change: 1 addition & 0 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/bundle.cjs.js",
"module": "dist/bundle.esm.js",
"browser": "dist/bundle.umd.js",
"type": "module",
"author": "",
"repository": {
"type": "git",
Expand All @@ -20,8 +21,8 @@
"build": "npm run build:lib && npm run build:demo",
"build:lib": "rollup -c",
"start": "npm run build:lib && concurrently -c \"cyan.bold,magenta.bold\" \"npm:build:lib -- -w\" \"npm:start:demo\" ",
"start:demo": "webpack serve --mode=development --config ./demo/webpack.config.js",
"build:demo": "webpack --mode=production --config ./demo/webpack.config.js",
"start:demo": "webpack serve --mode=development --config ./demo/webpack.config.cjs",
"build:demo": "webpack --mode=production --config ./demo/webpack.config.cjs",
"test": "HERE GOES YOUR TEST TASK",
"test:prod": "npm run lint",
"prepare": "husky install"
Expand All @@ -45,6 +46,7 @@
"@babel/cli": "7.23.0",
"@babel/core": "7.23.0",
"@babel/eslint-parser": "7.22.15",
"@babel/plugin-syntax-import-assertions": "^7.23.3",
"@babel/plugin-syntax-jsx": "^7.23.3",
"@babel/plugin-transform-react-jsx": "^7.22.15",
"@babel/preset-env": "7.22.20",
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import terser from '@rollup/plugin-terser';
import pkg from "./package.json";
import terser from "@rollup/plugin-terser";
import pkg from "./package.json" assert { type: "json" };

export default [
{
Expand Down

0 comments on commit 0941f68

Please sign in to comment.