fix(core): update

This commit is contained in:
2019-04-30 12:49:10 +02:00
parent 0b6409b468
commit 0a6a49b7ad
9 changed files with 319 additions and 196 deletions

View File

@ -1,3 +1,60 @@
import * as plugins from './tsbundle.plugins';
export let standardExport = 'Hi there! :) This is an exported string';
const rollupOptions: plugins.rollup.RollupOptions = {
input: `ts_web/index.ts`,
output: {
name: 'tsbundle',
// file: 'dist_web/bundle.js',
file: 'dist_web/bundle.js',
format: 'iife',
sourcemap: true
},
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [],
watch: {
include: ['src/**']
},
plugins: [
// Compile TypeScript files
plugins.rollupTypescript({
useTsconfigDeclarationDir: true,
tsconfigOverride: {
compilerOptions: {
declaration: true,
emitDecoratorMetadata: true,
experimentalDecorators: true,
inlineSourceMap: true,
noEmitOnError: true,
lib: ['es2016', 'es2017', 'dom'],
noImplicitAny: false
}
}
}),
// Allow node_modules resolution, so you can use 'external' to control
// which external modules to include in the bundle
// https://github.com/rollup/rollup-plugin-node-resolve#usage
plugins.rollupResolve(),
plugins.rollupCommonjs({
namedExports: {
'node_modules/@pushrocks/smartstate/dist/index.js': ['Smartstate']
}
}),
// Resolve source maps to the original source
plugins.rollupSourceMaps(),
plugins.rollupBabel({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
babelrc: false,
presets: [['@babel/preset-env', { modules: false }]]
})
]
};
async function build() {
// create a bundle
const bundle = await plugins.rollup.rollup(rollupOptions);
bundle.generate(rollupOptions.output);
bundle.write(rollupOptions.output);
}
build();

View File

@ -1,2 +1,15 @@
const removeme = {};
export { removeme };
import * as rollup from 'rollup';
import rollupResolve from 'rollup-plugin-node-resolve';
import rollupCommonjs from 'rollup-plugin-commonjs';
import rollupSourceMaps from 'rollup-plugin-sourcemaps';
import rollupTypescript from 'rollup-plugin-typescript2';
import rollupBabel from 'rollup-plugin-babel';
export {
rollup,
rollupResolve,
rollupCommonjs,
rollupSourceMaps,
rollupTypescript,
rollupBabel
};