0

I have a problem with my webpack congifuration. It runs without errors, but is not outputting any files other then app.js and index.html. Genetal styles are applied. Only thing that is not working is font

webpack ver ^3.5.6 extractTest ver ^3.0.0

const path = require('path');
const extractText = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');

const isProd = process.env.NODE_ENV === 'prod';
const cssDev = ['style-loader', 'css-loader', 'sass-loader'];
const cssProd = extractText.extract({
    filename: 'styles.css',
    fallback: 'style-loader',
    use: 'css-loader!sass-loader',
    publicPath: '/dist',

})

const cssConfig = isProd ? cssProd : cssDev;

module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dev'),
        filename: 'app.bundle.js'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: [/node_modules/, /__tests__/],
                use: 'babel-loader'
            },
            {
                test: /\.sass$/,
                use: cssConfig
            },
            {
                test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
                loader: 'file-loader'
            }
        ]
    },
    devServer: {
        historyApiFallback: true,
        contentBase: path.join(__dirname, 'dist'),
        compress: true,
        port: 3000,
        stats: 'errors-only'
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: 'Recipes',
            hash: true,
            template: './src/index.ejs'
        }),
        new extractText('style.css'),
        new webpack.HotModuleReplacementPlugin()

    ]
}
EDGECRUSHER
  • 83
  • 1
  • 10

0 Answers0