
This updates the rollup config to avoid having the spread operator in the generated code as that causes issues when people want to bundle our code with webpack (which doesn't support the spread operator for object literals). This also changes the browserbuild script to avoid issues for people running this on Windows. Hat-tip to @philltew for this one. Note that this is the first plugin where I'm updating the rollup config. I'll have to do the same for all plugins and patterns, but it's unlikely I'll write this long a commit message for each one of them :)
27 lines
712 B
JavaScript
27 lines
712 B
JavaScript
import { terser } from "rollup-plugin-terser";
|
|
import babel from "rollup-plugin-babel";
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
import json from "rollup-plugin-json";
|
|
import { version, name, description, author, license } from "./package.json";
|
|
|
|
export default {
|
|
input: "src/index.js",
|
|
output: {
|
|
sourcemap: true
|
|
},
|
|
plugins: [
|
|
resolve({
|
|
browser: true
|
|
}),
|
|
json(),
|
|
babel({
|
|
exclude: "node_modules/**",
|
|
plugins: ["@babel/plugin-proposal-object-rest-spread"]
|
|
}),
|
|
terser({
|
|
output: {
|
|
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
|
}
|
|
})
|
|
]
|
|
};
|