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

regexp '$' not working?' #16

Open
lake2 opened this issue Mar 8, 2019 · 1 comment
Open

regexp '$' not working?' #16

lake2 opened this issue Mar 8, 2019 · 1 comment

Comments

@lake2
Copy link

lake2 commented Mar 8, 2019

I what exclude bundle.js from this fragment

    <script src="bundle.js"></script>
<script type="text/javascript" src="bundle.js?5fc2c71bd09ffa7a3df9"></script>

this seems not working

    plugins: [
        new HtmlWebpackPlugin({
            hash: true,
            template: './static/index.html',
            excludeAssets: [/bundle.js[^?]/]
        }),
        new HtmlWebpackExcludeAssetsPlugin(),
    ],

How can I do this ?

@MangelMaxime
Copy link

I didn't test what I will say but the regex you provided doesn't match. Example

If you use /bundle.js.*/ as a regex then it will match the resource name. Example

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

2 participants