Skip to content

should scripts be compile into scripts.bundle.js instead of using script-loader? #7290

Closed
@zh99998

Description

@zh99998

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

currently global scripts are loaded by script-loader. which can't be optimize or minify, and can break some library rely on global context

library1.js

'use strict'
var library1 = function(){...}

another script rely on library1

library1(...)

they works well in traditional non-webpack environment, but currently they can't work because eval() is not allowed to add variable to context in strict mode.

since angular-cli is not allowed to modify webpack.config.js to use custom loaders.
is there any way to work-around let such a library script work now?

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