Coder Social home page Coder Social logo

add-asset-webpack-plugin's Introduction

add-asset-webpack-plugin's People

Contributors

lukehorvat avatar nullivex avatar richienb avatar silverwind avatar sindresorhus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

add-asset-webpack-plugin's Issues

import and use dynamically created file in src/ code?

Is there a way to use the dynamically created file as a dependency of another module? E.g.:

Webpack config:

    ...
    plugins: [
      new AddAssetPlugin(
        "file.js",
`export default {
   a: 1,
   b: 2,
   c: 3
}
`
      ),
    ...

Then in src/myapp.js:

import obj from 'file.js'

console.log(obj.a) // Outputs: 1

?

Webpack 5: DeprecationWarning: Compilation.assets will be frozen in future

Webpack 5 complains quite loudly about this plugin:

(node:15826) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
  Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
  Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
    at node_modules/add-asset-webpack-plugin/index.js:13:38
    at Hook.eval [as callAsync] (eval at create (node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:17)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.emitAssets (node_modules/webpack/lib/Compiler.js:763:19)
    at node_modules/webpack/lib/Watching.js:80:21
    at processTicksAndRejections (node:internal/process/task_queues:75:11)

Only add once for --watch mode

When running webpack --watch with incremental compilations and with a static string type source, the module will still add it on every incremental build which is useless and spams the log unneccesarily. Suggesting to emit a string asset only once during --watch. Function/Promise sources should of course be emitted every build because their content may change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.