by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:02
    sokra synchronize #7075
  • 12:01

    sokra on master

    5.0.0-beta.22 (compare)

  • 12:01

    sokra on v5.0.0-beta.22

    (compare)

  • 11:17
    sokra synchronize #7075
  • 11:17

    sokra on master

    chore(deps): bump terser-webpac… update snapshots Merge pull request #11061 from … (compare)

  • 11:17

    sokra on npm_and_yarn

    (compare)

  • 11:17
    sokra closed #11061
  • 11:16
    sokra synchronize #7075
  • 11:16

    sokra on master

    providing module do not overrid… Merge pull request #11144 from … (compare)

  • 11:16

    sokra on provide-no-override-loaded

    (compare)

  • 11:16
    sokra closed #11144
  • 11:16
    sokra synchronize #7075
  • 11:15

    sokra on master

    add roots option create new array in defaults Improve description in config s… and 1 more (compare)

  • 11:15
    sokra closed #11143
  • 09:44
    webpack-bot labeled #11144
  • 08:53
    webpack-bot unlabeled #11143
  • 08:53
    webpack-bot labeled #11143
  • 08:41
    webpack-bot labeled #11144
  • 08:41
    sokra opened #11144
  • 08:41

    sokra on provide-no-override-loaded

    providing module do not overrid… (compare)

Adam
@adamellsworth
Subject: worker-loader iOS/Safari behaviour
Content:
We're seeing an outcome (image attached) with using inline webworkers with webpack+worker-loader
The Worker-loader rule
{
    test: /\.worker\.js$/,
    use: [{
        loader: 'worker-loader',
        options: {
            inline: true,
            publicPath: url,
            fallback: false
        }
    }]
}

The import:

import MyWorker from './someworker.worker.js'
const worker = new MyWorker()

this behaviour is only shown to happen in iOS/Safari and we're not sure why
And the webpack output:

    output: {
        pathinfo: false,
        filename: 'app.js',
        path: __dirname + '/public',
        chunkFilename: '[id].worker.js'
    },
This happens in both Prod/Dev
It injects the blob://<hostUrl> instead of https://our.origin.uri/[id].worker.js
So embedding it on client websites is a no-go, and causes the entire app to not be able to render
but on all other browsers not Apple/iOS-based it does reference out.origin.uri/... correctly
Adam
@adamellsworth
The worker is super simple, and doesn't use any non-ios-friendly syntax (no transpiling necessary, just function, prototype, etc.)
Sorry if this is the wrong forum, but I found little infos about this issue elsewhere
beiketianzhuang
@beiketianzhuang
Hi
I met a problem
Runtime TypeError: Cannot read property 'call' of undefined at webpack_require
WalterEbbers
@WalterEbbers

hello @/all
i'm building a aurelia webpack(v4) asp.net core 3.1 application with the files in a wwwroot/dist folder and i am having a issue with the public path.
Default the value is "/" but if this is published to a folder structure like this "/companyname/profile/application/client/" it doesn't work.
By manually changing the value from "/" to "/companyname/profile/application/client/" it works, but since the application will be installed at different paths we want the path to be dynamic.

Has anyone ever had this issue and been able to have the public path dynamic?
I had a look at https://webpack.js.org/guides/public-path/#set-value-on-the-fly but not sure if i understand it correctly.
Does this solution read the public path from a environment.js? And must that environment.js be published in your wwwroot/dist folder?

Adam Di Mario
@nevnein
Hello everyone, I'm having some trouble splitting my polyfills into a separate file with @babel\preset-env using useBuiltIns: "true", if you could take a look at the question on SO I'd be very grateful
riten228
@riten228
Hello everyone, I/m trying to pass two variables via sass-loader, which I need in SCSS and stuck. I'm able to pass one variable via prependData. But, how to pass two variables? Any pointers?
matrixbot
@matrixbot
Yves * Surajkrishna: Have you found the solution for your multiple themes problem? I have the same situation: I need to build all the themes but load only one in my built index.html
Omkar Atluri
@omkarvijf41
Hello everyone, I'm having trouble splitting my node_modules and bundling. I am trying to split all node_modules except pdfjs-dist in vendor bundle because it's too heavy and want pdfjs-dist from node_modules in separate vendorPffjsBundle. Could you please help with me this.
optimization: {
    moduleIds: 'size',
    usedExports: true,
    sideEffects: true,
    splitChunks: {
      cacheGroups: {
      // Split vendor code to its own chunk(s)
      vendor: {
        test: /node_modules/,
        chunks: 'initial',
        // exclude: /node_modules\/(?!pdfjs-dist).*/,
        priority: 10,
        enforce: true,
        name: 'vendor',
        // name(module) {
        //   // get the name. E.g. node_modules/packageName/not/this/part.js
        //   // or node_modules/packageName
        //   console.log("omkar"+module.context)
        //   const splitPackage = module.context.includes('node_modules/pdfjs-dist/build')
        //   const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
        //   // npm package names are URL-safe, but some servers don't like @ symbols
        //   return `npm.${packageName.replace('@', '')}`;
        // }
      }
    }
    },
    minimizer: [
      new TerserJSPlugin({
        //Terser is new forked version of UglifyJsPlugin.
        parallel: true,
        terserOptions: {
          ecma: 6
        }
      })
    ]
  },
alvinhochun
@alvinhochun
Hi, can anyone explain for a bit how exactly is the filename hash of a WebAssembly file (.wasm) generated? I have two targets (one web, one webworker) that both use the same WASM module, and after setting optimization.usedExports = false I managed to get them to produce identical .wasm files, but their filenames are still different somehow.
I can force output.webassemblyModuleFilename for both to a static value, but this does not check that the output files are actually completely identical.
Rodrigo Toledo
@dhodo
Hi! I'm using webpack encore in Symfony (PHP). I have the problem that when I do a yarn build in production, I get a manifest.json not found error because this file is being creating at that moment. Does someone know how to do a yarn build in production in a way that the clients DO NOT realize that the website is being updated?? Thanks!
deAtog
@deAtog
@dhodo Have you tried removing the statement that cleans up the output directory before build?
Eric Chen
@Airkro
It 's possible to tree shake import('abc').then(({ default: abc }) => abc) ?
Rodrigo Toledo
@dhodo
@deAtog nop, it's there
maybe I should remove it yes.. but how I know then whtat should I delete not to get a lot of files there?
because I'd get a lot of files eventually
Rodrigo Toledo
@dhodo
@deAtog I'll make a script for that
thank you so much for your answer!! Help me a lot :)
deAtog
@deAtog
@dhodo When to remove old files can be difficult to determine. Users that have cached pages from your site will continue to need the old versions until their cache expires. You can alleviate this issue to some degree by explicitly setting an Expires header on all static content on your web server. Then once the expiration period has elapsed, you can safely remove the old files.
@dhodo If you do not set an Expires header on static content from your web server you can never be sure how long the old versions will be used.
Adi Sahar
@adi518
Hey all, does Webpack 5 beta actually support, although experimentally, tree shaking?
Fedor Nezhivoi
@gyzerok

Hello everyone!

It doesn't look like node: false option works for me. Here is my config.

module.exports = {
  entry: "iconv-lite",
  devtool: "source-map",
  mode: "production",
  output: {
    path: path.resolve(__dirname, "lib"),
    filename: "iconv-lite-umd.js",
    libraryTarget: "umd",
    globalObject: "typeof self !== 'undefined' ? self : this",
  },
  node: false,
  module: {
    rules: removeUnsupportedEncodings,
  },
  resolveLoader: {
    alias: {
      "fake-loader": path.resolve(__dirname, "fake-loader.js"),
    },
  },
};
I am trying to avoid bundling buffer shim
Fedor Nezhivoi
@gyzerok
I am using "webpack": "^4.43.0", "webpack-cli": "^3.3.11"
good luck
@chuzhixin

超棒的vue跨平台前端基础框架vue-admin-beautiful分享,适合学习,找工作,同时兼容手机,电脑,平板完全开源免费

演示地址:

http://chu1204505056.gitee.io/vue-admin-beautiful

演示地址2:

http://mpfhrd48.sanxing.uz7.cn/vue-admin-beautiful/

源码地址:

https://github.com/chuzhixin/vue-admin-beautiful

欢迎star

gitcatrat
@gitcatrat

Hey guys, do you know if and how it's possible to selectively append query string to dynamic import?

import(
  /* webpackChunkName: "chunk-name" */
  /* webpackMode: "lazy" */
  /* webpackPrefetch: true */
  './path/file.js'
).then(function (modules) {
  // do stuff
});

This would make an (example) request to https://www.example.com/chunk-name.js
How to selectively (i.e not all requests) get https://www.example.com/chunk-name.js?cachebuster=123

sanjib12
@sanjib12
HI
I wanted to use webpack loader from production dependencies in runtime
can anyone suggest me..
how to do this...
I have installed babel-loader in production. Now I have to use in runtime
Benny Neugebauer
@apfelbenny_twitter
Hello, is it possible to trigger a full page reload with "webpack-dev-middleware"? I tried using "invalidate" but it just creates a new bundle without refreshing the whole page:
const webpackCompiler = require('webpack')(require('../../webpack.config.dev'));
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const webpackBundle = webpackDevMiddleware(webpackCompiler);

this.app.use(webpackBundle);
this.app.use(webpackHotMiddleware(webpackCompiler));

const chokidar = require('chokidar');
chokidar
  .watch(path.join(__dirname, 'static/**/*.html'))
  .on('all', () => {
    webpackBundle.invalidate();
  });
Evilebot Tnawi
@evilebottnawi
It will be feature for v4 webpack-dev-server
Benny Neugebauer
@apfelbenny_twitter
Cool! Can I test this already with v4.0.0-rc.2?
Evilebot Tnawi
@evilebottnawi
It is out of scope webpack-dev-middleware, you need send a message to reload page to webpack-hot-middleware
webpack-dev-server will have this feature built-in
Benny Neugebauer
@apfelbenny_twitter
So for now I could send a message to webpack-hot-middleware as a workaround?
Evilebot Tnawi
@evilebottnawi
Yes
Benny Neugebauer
@apfelbenny_twitter
Ok, I will dig the API to find out how to do this. Thanks for pointing me in this direction. :)
gitcatrat
@gitcatrat

Hey guys, do you know if and how it's possible to append on-demand query string to dynamic import?

import(
  /* webpackChunkName: "chunk-name" */
  /* webpackMode: "lazy" */
  /* webpackPrefetch: true */
  './path/file.js'
).then(function (modules) {
  // do stuff
});

This would make an (example) request to https://www.example.com/chunk-name.js
How to selectively (i.e not all requests) get https://www.example.com/chunk-name.js?cachebuster=123

Any ideas?

Harshavardhan Surisetty
@harsha-iiiv

` webpack-dev-server --progress --colors --content-base ./client/public --config ./client/webpack.dev.config.js

✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration has an unknown property 'mode'. These properties are valid:
    object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
    For typos: please correct them.
    For loader options: webpack 2 no longer allows custom properties in configuration.
    Loaders should be updated to allow passing options via loader options in module.rules.
    Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
    plugins: [
    new webpack.LoaderOptionsPlugin({
      // test: /\.xxx$/, // may apply this only for some modules
      options: {
        mode: ...
      }
    })
    ]
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! sound-redux@1.0.0 start: webpack-dev-server --progress --colors --content-base ./client/public --config ./client/webpack.dev.config.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the sound-redux@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    `

` webpack-dev-server --progress --colors --content-base ./client/public --config ./client/webpack.dev.config.js

✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration has an unknown property 'mode'. These properties are valid:
    object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
    For typos: please correct them.
    For loader options: webpack 2 no longer allows custom properties in configuration.
    Loaders should be updated to allow passing options via loader options in module.rules.
    Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
    plugins: [
    new webpack.LoaderOptionsPlugin({
      // test: /\.xxx$/, // may apply this only for some modules
      options: {
        mode: ...
      }
    })
    ]
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! sound-redux@1.0.0 start: webpack-dev-server --progress --colors --content-base ./client/public --config ./client/webpack.dev.config.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the sound-redux@1.0.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    `

Please help me with this error

sanjib12
@sanjib12
Can anyone suggest me that how to use loader in webpack if I install loader as production dependency