chore: Started import of starfetch patterns
This commit is contained in:
parent
c3c25a5a1f
commit
885d3db845
14 changed files with 556 additions and 318 deletions
|
@ -1,43 +1,29 @@
|
|||
import url from '@rollup/plugin-url'
|
||||
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 { terser } from 'rollup-plugin-terser'
|
||||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
||||
// import postcss from 'rollup-plugin-postcss'
|
||||
import { main, module, name, version, description, author, license } from './package.json'
|
||||
import { name, version, description, author, license, main, module, rollup } from './package.json'
|
||||
|
||||
const banner = `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||
const output = [
|
||||
{
|
||||
banner,
|
||||
file: main,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: rollup.exports,
|
||||
},
|
||||
]
|
||||
if (typeof module !== 'undefined')
|
||||
output.push({
|
||||
banner,
|
||||
file: module,
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
})
|
||||
|
||||
export default {
|
||||
input: 'src/index.js',
|
||||
output: [
|
||||
{
|
||||
file: main,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'default'
|
||||
},
|
||||
{
|
||||
file: module,
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
exports: 'default'
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
peerDepsExternal(),
|
||||
// postcss({ modules: true }),
|
||||
url({ exclude: ['**/*.svg'] }),
|
||||
babel({
|
||||
exclude: 'node_modules/**'
|
||||
}),
|
||||
resolve({ browser: true }),
|
||||
json(),
|
||||
commonjs(),
|
||||
terser({
|
||||
output: {
|
||||
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||
}
|
||||
})
|
||||
]
|
||||
output,
|
||||
plugins: [peerDepsExternal(), resolve({ modulesOnly: true }), commonjs(), json()],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue