Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack 手写笔加载程序未编译网页包3中的文件_Webpack_Webpack 2_Stylus - Fatal编程技术网

Webpack 手写笔加载程序未编译网页包3中的文件

Webpack 手写笔加载程序未编译网页包3中的文件,webpack,webpack-2,stylus,Webpack,Webpack 2,Stylus,我正试图让Webpack编译我的手写笔文件,它正在导入所有文件,但似乎没有将任何内容编译成CSS 这是我的网页包配置文件: const webpack = require('webpack') const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const CleanWebpackPlugin = require('clean-webpack-plugin') const Ex

我正试图让Webpack编译我的手写笔文件,它正在导入所有文件,但似乎没有将任何内容编译成CSS

这是我的网页包配置文件:

const webpack = require('webpack')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const FaviconsWebpackPlugin = require('favicons-webpack-plugin')

const jeet = require('jeet')
const rupture = require('rupture')
const autoprefixer = require('autoprefixer-stylus')

module.exports = {
  entry: {
    app: './src/app.js',
    vendor: [
      'lodash'
    ]
  },
  devtool: 'inline-source-map',
  output: {
    // name will match each entry point above and 'chunkchash' will ensure each new build doesn't cache
    filename: '[name].[chunkhash].js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    rules: [
      // Process css styles
      {
        test: /\.styl$/,
        use: ExtractTextPlugin.extract({
          fallback: 'style-loader',
          use: [
            'css-loader', 'stylus-loader'
          ]
        })
      }
    ]
  },
  plugins: [
    // Delete old build so we have a fresh start each time
    new CleanWebpackPlugin(['dist']),
    // Process styles
    new webpack.LoaderOptionsPlugin({
      options: {
        stylus: {
          use: [
            jeet(),
            rupture(),
            autoprefixer({ browsers: ['> 3%'] })
          ]
        },
        context: '/'
      }
    }),
    // Don't inject the styles as a style tag, extract them into core.css
    new ExtractTextPlugin('core.css'),
    // Generate all our site icons
    // Generate our HTML files for us
    new HtmlWebpackPlugin({
      template: './src/app.html',
      filename: 'index.html',
      inject: 'body'
    }),
    // Prevent unchanging modules from updating their hash
    new webpack.HashedModuleIdsPlugin(),
    // Put common vendor chunks into their own bundle
    new webpack.optimize.CommonsChunkPlugin({
      name: 'vendor'
    }),
    // Put common internal chunks into their own bundle
    new webpack.optimize.CommonsChunkPlugin({
      name: 'common'
    })
  ]
}
为了简洁起见,我删除了一些与样式无关的加载程序,在webpack.dev.js和webpack.prod.js中还有其他与样式无关的东西

正如其他人在其他帖子上评论的那样,手写笔加载器文档非常糟糕,我现在查看了这么多资源,我无法分辨哪些部分是Webpack1,哪些部分是Webpack2或Webpack3


顺便说一句,我正在使用Webpack v3.6.0,但是如果我的问题可以通过切换到2来解决,我很乐意这样做。

删除节点模块并再次运行npm安装似乎可以解决问题,这一定是一个bug/兼容性问题。