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:
32
rollup.config.js
Normal file
32
rollup.config.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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 copy from "rollup-plugin-copy";
|
||||
import sass from "rollup-plugin-sass";
|
||||
|
||||
// `npm run build` -> `production` is true
|
||||
// `npm run dev` -> `production` is false
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
export default {
|
||||
input: 'test/index.jsx',
|
||||
output: {
|
||||
file: 'public/index.js',
|
||||
format: 'iife', // immediately-invoked function expression — suitable for <script> tags
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [
|
||||
sass(),
|
||||
babel(), // babel
|
||||
resolve(), // node_modules
|
||||
commonjs(), // CJS-modules
|
||||
production && terser(), // minify, but only in production
|
||||
copy({
|
||||
targets: [
|
||||
{ src: 'test/index.html', dest: 'public' }
|
||||
],
|
||||
copyOnce: true
|
||||
})
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user