Skip to content

path not working (output location) #137

@jairusd

Description

@jairusd

Hi, I specified the path in the plugin MiniCssExtractPlugin options but it keeps getting generated in my default output path that i also specified in my webpack. Can anyone help me in this issue? :) thanks

const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

const build = path.resolve(__dirname, './public')
const js = path.resolve(__dirname, './src')

const config = {
  entry: {
    client: js + '/client',
    plugins: js + '/plugins'
  },
  output: {
    path: build + '/js',
    filename: '[name].js'
  },
  module: {
    rules: [
      {
        test: /\.jsx?/,
        loader: 'babel-loader',
        include: js,
        exclude: /node_modules/
      },
      {
        test: /\.scss$/,
        use: ['style-loader', MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader']
      }
    ]
  },
  plugins: [
    new MiniCssExtractPlugin({
      path: build + '/css',
      publicPath: build,
      filename: 'main.css'
    })
  ]
}

module.exports = config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions