FAQ

How to import zepto modules?

First, run this command in your project directory:

npm i -D exports-loader script-loader

// OR install with yarn
yarn add -D exports-loader script-loader

Then, edit balm config:

balm.config = {
  ...
  scripts: {
    ...
    loaders: [{
      test: /zepto\.js/,
      loader: 'exports-loader?window.Zepto!script-loader'
    }],
    alias: {
      zeptoSrc: 'zepto/src'
    }
  },
  ...
};

And, use it in /path/to/project/app/scripts/main.js:

import $ from 'zeptoSrc/zepto';
import 'zeptoSrc/event';

// Enjoy coding

npm@2.x.x bug

Q1:

Error: Cannot find module 'babel-runtime/helpers/classCallCheck'

A1:

npm install babel-runtime

Q2:

Error: Cannot resolve module 'webpack-hot-middleware/client' in /path/to/your_project

A2:

npm install webpack-hot-middleware

results matching ""

    No results matching ""