Skip to content

Commit

Permalink
got rollup working again
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanjay Soundarajan committed Nov 6, 2021
1 parent 74812ea commit 30c5256
Show file tree
Hide file tree
Showing 10 changed files with 1,409 additions and 769 deletions.
15 changes: 10 additions & 5 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import replace from "@rollup/plugin-replace";
import babel from "@rollup/plugin-babel";
import PostCSS from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";
import typescript from "rollup-plugin-typescript2";
import minimist from "minimist";

// Get browserslist config and remove ie from es build targets
Expand All @@ -28,7 +29,7 @@ const argv = minimist(process.argv.slice(2));
const projectRoot = path.resolve(__dirname, "..");

const baseConfig = {
input: "src/entry.js",
input: "src/entry.ts",
plugins: {
preVue: [
alias({
Expand Down Expand Up @@ -80,6 +81,7 @@ const external = [
const globals = {
// Provide global variable names to replace your external imports
// eg. jquery: '$'

vue: "Vue",
};

Expand All @@ -88,14 +90,15 @@ const buildFormats = [];
if (!argv.format || argv.format === "es") {
const esConfig = {
...baseConfig,
input: "src/entry.esm.js",
input: "src/entry.esm.ts",
external,
output: {
file: "dist/vue3-marquee.esm.js",
file: "dist/vue3-marquee.esm.ts",
format: "esm",
exports: "named",
},
plugins: [
typescript(),
replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
Expand Down Expand Up @@ -123,13 +126,14 @@ if (!argv.format || argv.format === "cjs") {
external,
output: {
compact: true,
file: "dist/vue3-marquee.ssr.js",
file: "dist/vue3-marquee.ssr.ts",
format: "cjs",
name: "Vue3Marquee",
exports: "auto",
globals,
},
plugins: [
typescript(),
replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
Expand All @@ -146,13 +150,14 @@ if (!argv.format || argv.format === "iife") {
external,
output: {
compact: true,
file: "dist/vue3-marquee.min.js",
file: "dist/vue3-marquee.min.ts",
format: "iife",
name: "Vue3Marquee",
exports: "auto",
globals,
},
plugins: [
typescript(),
replace(baseConfig.plugins.replace),
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
Expand Down
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
text: "Guide",
link: "/guide",
},
{ text: "V2.0", link: "/v2/guide" },
{
text: "Examples",
link: "/examples",
Expand Down
Loading

0 comments on commit 30c5256

Please sign in to comment.