question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not delete js files...

See original GitHub issue

This is my config:

const config = {
    target: "web",
    entry: {
        vendor: [
            'js/bootstrap.js',
            'js/classie.js',
            'js/html5element.js',
            'js/html5shiv.js',
            'js/jquery.1.8.3.min.js',
            'js/jquery.easing.1.3.js',
            'js/jquery.isotope.js',
            'js/jquery-scrolltofixed.js',
            'js/respond-1.1.0.min.js',
            'js/wow.js',

            'css/animate.css',
            'css/bootstrap.css',
            'css/font-awesome.css',
            'css/linecons.css',
            'css/responsive.css',
        ],
        style: ['css/style.css']
    },
    output: {
        publicPath: "/files/",
        path: path.resolve(__dirname, 'public/files'),
        filename: '[name].js',
    },
    devServer: { // https://webpack.js.org/configuration/dev-server
        port: 4444,
        progress: true,
        writeToDisk: true,
    },
    devtool: "source-map",
    plugins: [
        new CleanWebpackPlugin(),
        new FixStyleOnlyEntriesPlugin(),
        new MiniCssExtractPlugin({
            filename: '[name].css'
        }),
    ],
    module: {
        rules: [
            {
                test: /\.html$/,
                use: [
                    'extract-loader',
                    {
                        loader: 'html-loader',
                        options: {
                            // minimize: true,
                            interpolate: true,
                            attrs: ["img:src", "link:href"]
                        }
                    },
                ]
            },
            {
                test: /\.(png|jpe?g|gif)$/,
                use: [
                    {
                        loader: 'file-loader',
                        options: {
                            outputPath: 'images/',
                            name: '[name].[ext]'
                        }
                    }
                ]
            },
            {
                test: /\.(woff2?|ttf|eot|svg)(\?.*?)?$/,
                use: [
                    {
                        loader: 'file-loader',
                        options: {
                            outputPath: 'fonts/',
                            name: '[name].[ext]'
                        }
                    },
                ]
            },
            {
                test: /\.js$/,
                use: 'babel-loader',
                exclude: /node_modules/
            },
            {
                test: /\.css$/,
                use: [
                    {
                        loader: MiniCssExtractPlugin.loader,
                        options: {
                            hmr: false
                        }
                    },
                    {
                        loader: 'css-loader',
                        options: {
                            sourceMap: true
                        }
                    }
                ]
            }
        ]
    },
    resolve: {
        modules: [path.resolve(__dirname, 'src'), 'node_modules'],
    },
    resolveLoader: {
        moduleExtensions: ['-loader']
    }
};

After running webpack-dev-server, the files are generated and the css and js files for the style entry is still there

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vadymmasiukcommented, May 24, 2020

Well, I answered without paying attention to the actual issue.

I don’t think webpack-dev-server works the same as a webpack regular build. Probably something similar to webpack-hot-middleware.

See:

Ok, got it, and thanks for quick response. That was actually similar problem to what you have mentioned. Just in case somebody will face similar issue, plugin must be with passed ignoring option, like next:

{
plugins: [
        new FixStyleOnlyEntriesPlugin({ ignore: 'webpack-dev-server' }),
        new MiniCssExtract({
            filename: 'css/[name].css',
            chunkFilename: '[id].css',
        })
    ],
}
0reactions
fqborgescommented, Oct 7, 2020

solved!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to delete a file in Windows using javascript in node.js
fs.exists() is deprecated because of concurrency issues. In a multi-tasking OS, the file can be removed between the call to fs.exists ...
Read more >
Is it safe to delete the .js files in my - Apple Support Communities
I have a bunch of . js files in my developer folder (in finder) and wanted ot know if I can delete them,...
Read more >
What are JS files? Can I delete them? : r/MacOS - Reddit
Finder search is trash anyway. Don't delete any JS files unless you know what you are doing (judging by the question, you don't)....
Read more >
VS 2015 Update 3 Clean deletes .js files it shouldn't #10281
It seems that on clean/rebuild action, the Reflect.js file was being deleted. I believe this is due to Reflect.ts being included in the...
Read more >
How to Force Delete A File on Windows 11/10/8/7? [Can't ...
How to Force Delete a File That Cannot Be Deleted Windows 11/10 · 1. End Task from Task Manager, Go to Start, type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found