All Projects → resisttheurge → babel-webpack-package-boilerplate

resisttheurge / babel-webpack-package-boilerplate

Licence: other
boilerplate for building an npm package using webpack, with next-gen javascript transpilation through babel

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babel-webpack-package-boilerplate

webpack-typescript-react
Webpack 5 boilerplate with support of most common loaders and modules (see tags and description)
Stars: ✭ 185 (+704.35%)
Mutual labels:  webpack-configuration, webpack-boilerplate
webpack-boilerplate
Webpack 4 boilerplate with Babel, Bootstrap 4, jQuery and SCSS on board
Stars: ✭ 24 (+4.35%)
Mutual labels:  webpack-boilerplate
Webpack Chain
A chaining API to generate and simplify the modification of Webpack configurations.
Stars: ✭ 2,821 (+12165.22%)
Mutual labels:  webpack-configuration
plebpack
Webpack configuration for the common people.
Stars: ✭ 13 (-43.48%)
Mutual labels:  webpack-configuration
Webpack Config
Helps to load, extend and merge webpack configs
Stars: ✭ 244 (+960.87%)
Mutual labels:  webpack-configuration
vscode-exts
Visual Studio Code Extensions
Stars: ✭ 33 (+43.48%)
Mutual labels:  webpack-configuration
Baumeister
👷 The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+643.48%)
Mutual labels:  webpack-configuration
esri-webpack-babel
A bare bones example showing how to use the ArcGIS API for JavaScript in an application built with webpack and Babel to compile ES2015 modules.
Stars: ✭ 18 (-21.74%)
Mutual labels:  webpack-configuration
vue-webpack-boilerplate
A webpack boilerplate with vue-loader, axios, vue-router and vuex
Stars: ✭ 51 (+121.74%)
Mutual labels:  webpack-boilerplate
react-ts-webpack-boilerplate
This is the ultimate lightweight boilerplate needed for a React application using typescript with webpack
Stars: ✭ 17 (-26.09%)
Mutual labels:  webpack-boilerplate
webpack-mix
Elegant wrapper around Webpack for more than 80% use cases.
Stars: ✭ 51 (+121.74%)
Mutual labels:  webpack-configuration
Frontend Webpack Boilerplate
Simple starter webpack 5 project template supporting SASS/PostCSS, Babel ES7, browser syncing, code linting. Easy project setup having multiple features and developer friendly tools.
Stars: ✭ 242 (+952.17%)
Mutual labels:  webpack-configuration
webpack-config
Webpack 5 configuration for static projects...
Stars: ✭ 96 (+317.39%)
Mutual labels:  webpack-configuration
Wpk
a friendly, intuitive & intelligent CLI for webpack
Stars: ✭ 232 (+908.7%)
Mutual labels:  webpack-configuration
django-manifest-loader
Simplifies webpack configuration with Django
Stars: ✭ 105 (+356.52%)
Mutual labels:  webpack-configuration
Gulp Webpack Starter
Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!
Stars: ✭ 199 (+765.22%)
Mutual labels:  webpack-configuration
chunks-webpack-plugin
Create HTML files with entrypoints and chunks relations to serve your bundles
Stars: ✭ 22 (-4.35%)
Mutual labels:  webpack-configuration
multi-vue-webpack
A multi entry vue project template
Stars: ✭ 18 (-21.74%)
Mutual labels:  webpack-boilerplate
skeleton-loader
Loader module for webpack to execute your custom procedure. It works as your custom loader.
Stars: ✭ 19 (-17.39%)
Mutual labels:  webpack-configuration
angularjs-es6-starter-kit
Basic AngularJS, ES6, Webpack Starter Kit Project which includes Bootstrap 4 also. This is a boilerplate for AngularJS SPA with Bootstrap 4.
Stars: ✭ 28 (+21.74%)
Mutual labels:  babel-webpack

babel-webpack-package-boilerplate

Now updated for webpack 2!

This project is meant to show how easy and useful it can be to use webpack as a tool-chain for npm packages.

Fun things in this project:

  • Source code and tests for the package are written with es2015+ and stage-0 features (specifically the features supported by the [env] and stage-0 presets for babel). See any *.js files in src for examples. See .babelrc for the babel configuration, and config/rules.js to see how babel was integrated into webpack.
  • Platform-specific polyfills and transpilation. Use of the [env] preset for babel allows webpack to avoid unused polyfills and source code transforms if the target platform supports them. See .babelrc to see how the preset was configured to support this.
  • Tree-shaking transpilation through webpack 2 and es2015+ modules. Due to the statically-analyzable module system provided by next-generation JavaScript, webpack can remove unused code and dependencies at transpiletime, resulting in smaller built artifacts.
  • Modules in lib directories can be loaded universally, like modules found in node_modules. See src/main.js and src/test/index.js for examples. See modules in config/resolve.js to see how this was configured.
  • Modules in src that end with *test.js and modules that are direct children of test directories can be run as mocha test modules, which will automatically be processed using webpack.

Getting Started

Clone the repository and install dependencies with npm.

$ git clone https://github.com/resisttheurge/babel-webpack-package-boilerplate.git
$ cd babel-webpack-package-boilerplate
$ npm install

Building

The build script defined in the package.json file uses webpack to transpile sources in the src directory. The successfully transpiled sources are placed in the dist folder. This folder is preserved by npm, but ignored by git.

$ npm run build

Watch-style building is supported by the build:watch script.

$ npm run build:watch

The prestart, and prepublish scripts defined in the package.json file reference the build script, so there's no need to run the build script manually in those situations.

Running

Run the project with npm start.

$ npm start

  hello, world!

As said before, this will automatically run the build script first.

Testing

Test the project with npm test.

$ npm test

Watch-style testing is supported by the test:watch script.

$ npm run test:watch

Publishing

Publish the project on the local machine (for testing) with npm install.

$ npm install . -g
$ babel-webpack-package-boilerplate

  hello, world!

Publish the package globally with npm publish.

$ npm publish
$ npm install -g babel-webpack-package-boilerplate
$ babel-webpack-package-boilerplate

  hello, world!

In both cases, again, this will automatically run the build script after installation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].