Skip to content

Stychen/npm-module-webpack-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm-module-webpack-boilerplate

A boilerplate for making npm modules, bundled with webpack and written in ES6.

Contents

Features

  • ES6 with Babel
  • Bundle with Webpack
  • Run tests and tdd with karma in ES6

Getting Started

Clone the repo

git clone git@github.com:Stychen/npm-module-webpack-boilerplate.git <your-new-repo-name>
cd <your-repo-name>
npm install

Update package.json

Open up package.json and update to your liking. Important: Change module_name_here in package.json to your module_name. Also in webpack.config.js, change module_name_here.

Build your module

Your module's entry path is at src\index.js and the output path is at lib\<module_name>.min.js. This can be edited at webpack.config.js.

  1. For production
npm run build

This will run webpack to bundle minified versions of your library in ./lib with sourcemaps.

  1. For development
npm start

This will run the webpack build in watch mode.

Test your module

  1. For testing

    npm run test

    This will run tests in ./test that are named **_test.js (ie: sample_test.js).

  2. For test driven development

    npm run tdd

    This will run karma in tdd mode

Upload your npm module

After your done with development of your npm module. You can upload your module in npmjs.com https://docs.npmjs.com/getting-started/publishing-npm-packages

About

A boilerplate for making npm modules, bundled with webpack and written in ES6.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors