@baaz/buildpack

1.1.3 • Public • Published

@baaz/buildpack npm version

React + @baaz/buildpack + @baaz/buildpack

1. Getting Started

  • You need to create a webpack.config.js.
// ...
const {
  configureWebpack
} = require('@baaz/buildpack');
const HtmlWebPackPlugin = require("html-webpack-plugin");
const { DefinePlugin } = require('webpack');

module.exports = async (env, argv = {}) => {

  const { clientConfig, serviceWorkerConfig } = await configureWebpack({
    context: __dirname,
    vendor: [
      // 'react',
      // 'react-dom',
    ],
    special: {
      // 'buikit': {
      //   cssModules: true,
      //   esModules: true,
      // },
      // '@baaz/adapter': {
      //   esModules: true,
      //   cssModules: true
      // }
    },
    env,
    argv
  });


  clientConfig.plugins = [
    ...clientConfig.plugins,
     new DefinePlugin({
      /**
       * Make sure to add the same constants to
       * the globals object in jest.config.js.
       */
      PWA_NAME: JSON.stringify('BAAZ PWA')
    }),
    new HtmlWebPackPlugin({
      template: "./template.html",
      filename: "./index.html"
    })
  ];

  return [clientConfig, serviceWorkerConfig];
};

//...

2. babel.config.js

create a babel.config.js

module.exports = { presets: ['@baaz/adapter'] };

Package Sidebar

Install

npm i @baaz/buildpack

Weekly Downloads

6

Version

1.1.3

License

ISC

Unpacked Size

23.4 kB

Total Files

15

Last publish

Collaborators

  • dominic_george