refactor: Split plugin-gore from holmes pattern
This commit is contained in:
parent
7d02c76bc8
commit
992b010354
13 changed files with 635 additions and 100 deletions
|
@ -1,47 +1,41 @@
|
|||
import babel from "rollup-plugin-babel";
|
||||
import commonjs from "rollup-plugin-commonjs";
|
||||
import external from "rollup-plugin-peer-deps-external";
|
||||
import postcss from "rollup-plugin-postcss";
|
||||
import json from "rollup-plugin-json";
|
||||
import resolve from "rollup-plugin-node-resolve";
|
||||
import url from "rollup-plugin-url";
|
||||
import svgr from "@svgr/rollup";
|
||||
import minify from "rollup-plugin-babel-minify";
|
||||
import { name, version, description, author, license } from "./package.json";
|
||||
import babel from 'rollup-plugin-babel'
|
||||
import resolve from 'rollup-plugin-node-resolve'
|
||||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import json from 'rollup-plugin-json'
|
||||
import minify from 'rollup-plugin-babel-minify'
|
||||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
||||
import { name, version, description, author, license, main, module } from './package.json'
|
||||
|
||||
import pkg from "./package.json";
|
||||
const output = [
|
||||
{
|
||||
file: main,
|
||||
format: 'cjs',
|
||||
sourcemap: true
|
||||
}
|
||||
]
|
||||
if (typeof module !== 'undefined')
|
||||
output.push({
|
||||
file: module,
|
||||
format: 'es',
|
||||
sourcemap: true
|
||||
})
|
||||
|
||||
export default {
|
||||
input: "src/index.js",
|
||||
output: [
|
||||
{
|
||||
file: pkg.main,
|
||||
format: "cjs",
|
||||
sourcemap: true
|
||||
},
|
||||
{
|
||||
file: pkg.module,
|
||||
format: "es",
|
||||
sourcemap: true
|
||||
}
|
||||
],
|
||||
input: 'src/index.js',
|
||||
output,
|
||||
plugins: [
|
||||
external(),
|
||||
postcss({
|
||||
modules: true
|
||||
}),
|
||||
url({ exclude: ["**/*.svg"] }),
|
||||
svgr(),
|
||||
babel({
|
||||
exclude: "node_modules/**"
|
||||
}),
|
||||
resolve({ browser: true }),
|
||||
json(),
|
||||
peerDepsExternal(),
|
||||
resolve({ modulesOnly: true }),
|
||||
commonjs(),
|
||||
json(),
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
plugins: ['@babel/plugin-proposal-object-rest-spread']
|
||||
}),
|
||||
minify({
|
||||
comments: false,
|
||||
sourceMap: true,
|
||||
banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||
})
|
||||
]
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue