Initial version to monorepo-setup to start experimenting with, featuring a fork of @babel JSX-transformation, and a crude VDOM>DOM rendering-step. The Custom-Elements part is just a placeholder at this point but ready to be populated with base-classes and decorators.
This commit is contained in:
30
packages/csx-custom-elements/rollup.config.js
Normal file
30
packages/csx-custom-elements/rollup.config.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import json from "rollup-plugin-json";
|
||||
|
||||
// `npm run build` -> `production` is true
|
||||
// `npm run dev` -> `production` is false
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
export default {
|
||||
input: 'src/index.js',
|
||||
output: {
|
||||
file: 'dist/index.js',
|
||||
format: 'cjs', // immediately-invoked function expression — suitable for <script> tags
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [
|
||||
json(), // Add json support (sadly in rollup we have to do this explicity, despite the NodeJS algorithm supporitng this by defulat
|
||||
babel(), // babel (the reason we're doing all of this, babel transpiling)
|
||||
resolve({// node_modules (again we have to add support in rollup for something that is NodeJS default)
|
||||
}),
|
||||
commonjs({ // CJS-modules (require-style bundle support, again something rollup doesnt handle by default)
|
||||
}),
|
||||
production && terser() // minify, but only in production
|
||||
],
|
||||
external: [
|
||||
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user