Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用html-webpack-plugin后,dev下首次可以成功,修改代码后,无法在浏览器中看到页面 #46

Closed
SSebo opened this issue Jan 13, 2016 · 1 comment

Comments

@SSebo
Copy link

SSebo commented Jan 13, 2016

用antd-init出来的新工程,在webpack中加入html plugin,index.html删除js css的引入

webpack配置如下

var webpack = require('atool-build/lib/webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = function(webpackConfig) {
  webpackConfig.module.loaders.forEach(function(loader) {
    if (loader.loader === 'babel') {
      // https://github.com/ant-design/babel-plugin-antd
      loader.query.plugins.push('antd');
    }
    return loader;
  });

  webpackConfig.plugins.push(
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
    })
  );

  // Fix ie8 compatibility
  webpackConfig.module.loaders.unshift({
    test: /\.jsx?$/,
    loader: 'es3ify',
  });

  return webpackConfig;
};

报错:
DateTHead.js:15Uncaught TypeError: Super expression must either be null or a function, not undefined

@SSebo SSebo closed this as completed Jan 13, 2016
@SSebo
Copy link
Author

SSebo commented Jan 13, 2016

html-webpack-plugin 1.7.0 没问题, 2有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant