Skip to content

Commit

Permalink
Use rollup instead webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
KODerFunk committed Jan 29, 2018
1 parent e57d0ee commit db3f3b3
Show file tree
Hide file tree
Showing 21 changed files with 2,574 additions and 5,271 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ $('.some-selector').filter('.jquery-chain').each$(($element) => {
## Roadmap

- More readme and documentation
- Use rollup for build dist
- More examples of usage with actual javascript plugins and libs
- Improve debugging
- Optional jQuery usage
Expand Down
49 changes: 49 additions & 0 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
// import memory from 'rollup-plugin-memory';

const bundles = [{
name: 'normas',
input: 'src/js/index.js',
}, {
name: 'normasWithTurbolinks',
input: 'src/js/normasWithTurbolinks.js',
}, {
name: 'normasMutations',
input: 'src/js/mixins/mutations.js',
}];

export default bundles.map(({ name, input }) => ({
input,
output: {
strict: true,
file: `dist/js/${name}.js`,
format: 'cjs',
name,
sourcemap: true
},
plugins: [
// memory({
// path: 'src/normas.js',
// contents: `
// import normas from './normas';
// if (typeof module!='undefined') module.exports = normas;
// else self.normas = normas;
// `
// }),
nodeResolve({
// module: true,
// jsnext: true,
// browser: true,
// main: true,
// jail: '/src/js',
// modulesOnly: true,
}),
babel({
sourceMap: true,
exclude: 'node_modules/**',
}),
commonjs(),
]
}));
Loading

0 comments on commit db3f3b3

Please sign in to comment.