VanillaJS (pure JavaScript) plugin starter with Webpack 4 and Babel 7.
git clone -b webpack-4-babel-7 https://github.com/thatisuday/js-plugin-starter.git [dest]
Here,
dest
is your destination directory in which the boilerplate code will be copied.
- Use
npm install
command to install dependencies. - Execute command
npm run start
to run webpack development server and top open preview in the browser. - Execute command
npm run build
to create plugin distribution files in thedist
directory. - Tweak configuration inside
config
folder if necessary. - Configure plugin API using this documentation.
- Install React preset using
npm i -D @babel/preset-react
command. - Update
babel.config.js
file with this new preset. Follow these instructions. - Update
/\.js$/
with/\.jsx?$/
insidewebpack.config.js
to compile JavaScript files with.jsx
extensions. - Install React and ReactDOM using
npm i -S react react-dom
command.