resisttheurge / babel-webpack-package-boilerplate Goto Github PK
View Code? Open in Web Editor NEWboilerplate for building an npm package using webpack, with next-gen javascript transpilation through babel
boilerplate for building an npm package using webpack, with next-gen javascript transpilation through babel
I'm building a simple package, that only has one exported function. I am a bit confused by the following files and how to use them:
src/lib/index.js
src/lib/[moduleName]/index.js
src/main.js
If you were building a module with one source file and one named export, how would you structure the code and why?
Thanks!
You might be interested in this:
directories.bin
If you specify a bin directory in directories.bin, all the files in that folder will be added.
Because of the way the bin directive works, specifying both a bin path and setting directories.bin is an error. If you want to specify individual files, use bin, and for all the files in an existing bin directory, use directories.bin.
Thanks for the fantastic boilerplate. I'm new to webpack, and was wondering if you could point me in the right direction?
I want to add the lodash-webpack-plugin to the webpack build pipeline, but don't really understand your webpack config file setup. The docs want me to modify the webpack.config.js
as follows:
var webpack = require('webpack');
module.exports = {
'module': {
'loaders': [{
'loader': 'babel',
'test': /\.js$/,
'exclude': /node_modules/,
'query': {
'plugins': ['lodash'],
'presets': ['es2015']
}
}]
},
'plugins': [
new LodashModuleReplacementPlugin,
new webpack.optimize.OccurrenceOrderPlugin,
new webpack.optimize.UglifyJsPlugin
]
};
Can you suggest how to do this, within this boilerplate?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.