Skip to content

VanillaJS (pure JavaScript) plugin starter with Webpack 4 and Babel 7.

Notifications You must be signed in to change notification settings

seeratawan01/js-plugin-boilerplate

Repository files navigation

VanillaJS (pure JavaScript) plugin Boilerplate

VanillaJS (pure JavaScript) plugin starter with Webpack 5 and Babel 7.

Here, dest is your destination directory in which the boilerplate code will be copied.

Instructions

  • Use npm install command to install dependencies.
  • Execute command npm run serve to run webpack development server and top open preview in the browser.
  • Execute command npm run build to create plugin distribution files in the dist directory.
  • Tweak configuration inside config folder if necessary.
  • Configure plugin API using this documentation.

React.js plugin development

  • 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?$/ inside webpack.config.js to compile JavaScript files with .jsx extensions.
  • Install React and ReactDOM using npm i -S react react-dom command.