55 lines
1.6 KiB
JavaScript
55 lines
1.6 KiB
JavaScript
import resolve from 'rollup-plugin-node-resolve';
|
|
import commonjs from 'rollup-plugin-commonjs';
|
|
import sourceMaps from 'rollup-plugin-sourcemaps';
|
|
import typescript from 'rollup-plugin-typescript2';
|
|
import json from 'rollup-plugin-json';
|
|
import babel from 'rollup-plugin-babel';
|
|
import nodeResolve from 'rollup-plugin-node-resolve';
|
|
|
|
const pkg = require('./package.json');
|
|
|
|
export default {
|
|
input: `ts_web/index.ts`,
|
|
output: {
|
|
file: 'dist/bundle.js',
|
|
format: 'es',
|
|
sourcemap: true
|
|
},
|
|
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
|
external: [],
|
|
watch: {
|
|
include: 'src/**'
|
|
},
|
|
plugins: [
|
|
// Allow json resolution
|
|
json(),
|
|
// Compile TypeScript files
|
|
typescript({ useTsconfigDeclarationDir: true, tsconfigOverride: {
|
|
compilerOptions: {
|
|
declaration: true,
|
|
emitDecoratorMetadata: true,
|
|
experimentalDecorators: true,
|
|
inlineSourceMap: true,
|
|
noEmitOnError: true,
|
|
lib: ['es2016', 'es2017', 'dom'],
|
|
noImplicitAny: false
|
|
}
|
|
} }),
|
|
nodeResolve(),
|
|
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
|
|
commonjs({
|
|
namedExports: {
|
|
'node_modules/@pushrocks/smartstate/dist/index.js': ['SmartState']
|
|
}
|
|
}),
|
|
// 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
|
|
resolve(),
|
|
|
|
// Resolve source maps to the original source
|
|
sourceMaps(),
|
|
babel()
|
|
]
|
|
};
|