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

Process script and link tags does not work #284

Closed
mkausl opened this issue Apr 30, 2020 · 7 comments
Closed

Process script and link tags does not work #284

mkausl opened this issue Apr 30, 2020 · 7 comments

Comments

@mkausl
Copy link

mkausl commented Apr 30, 2020

  • Operating System: macos catalina
  • Node Version: v12.13.1
  • NPM Version: 6.13.6
  • webpack Version: 5.0.0-beta.15 (also tried with latest 4.x)
  • html-loader Version: 1.1.0

Expected Behavior

I tried the example "Process script and link tags" from the README.

module.exports = {
    entry: {
        index: './src/index.html'
    },
    module: {
        rules: [
            {
                test: /\.html$/i,
                use: ['file-loader?name=[name].[ext]', 'extract-loader', 'html-loader'],
            },
            {
                test: /\.js$/i,
                exclude: /\.file.js$/i,
                loader: 'babel-loader',
            },
            {
                test: /\.file.js$/i,
                loader: 'file-loader',
            }
        ],
    }
};

index.html contains <script src="./app.file.js"></script>

Actual Behavior

index.html output contains <script src=[object Object]></script>

Code

see above

How Do We Reproduce?

Setup the example "Process script and link tags" from the README.

@alexander-akait
Copy link
Member

Please create full reproducible test repo, I can't reproduce, we have tests for this

@mkausl
Copy link
Author

mkausl commented Apr 30, 2020

thanks for the fast reply.
i zipped my project. just unzip and run npx webpack
Archive.zip

@alexander-akait
Copy link
Member

It is not supported right now, we have roadmap for this for webpack@5 https://github.com/webpack/webpack/projects/5#card-29122473

@dipeshba
Copy link

@evilebottnawi if i install webpack 5 beta will this work?

@alexander-akait
Copy link
Member

Not, sure, need test

@alexander-akait
Copy link
Member

Let's close in favor webpack@5, we can't fix it on our side

@x35a
Copy link

x35a commented Oct 3, 2020

Hi all. I've faced the same problem.
so is there an option to insert a <script src=''> tag with correct src path?
@dipeshba @evilebottnawi

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

4 participants