Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 08 22:44
    vankop synchronize #10670
  • Apr 08 22:25
    webpack-bot unlabeled #10670
  • Apr 08 22:25
    webpack-bot labeled #10670
  • Apr 08 22:24
    vankop synchronize #10670
  • Apr 08 21:12
    sokra synchronize #7075
  • Apr 08 21:12

    sokra on master

    test for #10623 fix(InnerGraph): #10623 update test case and 4 more (compare)

  • Apr 08 21:12
    sokra closed #10661
  • Apr 08 20:21
    webpack-bot labeled #10661
  • Apr 08 20:21
    webpack-bot unlabeled #10661
  • Apr 08 20:16
    sokra synchronize #10661
  • Apr 08 19:44
    webpack-bot synchronize #7075
  • Apr 08 19:44

    webpack-bot on master

    chore(deps-dev): bump @types/no… Merge pull request #10688 from … (compare)

  • Apr 08 19:44

    webpack-bot on npm_and_yarn

    (compare)

  • Apr 08 19:44
    webpack-bot closed #10688
  • Apr 08 19:43
    webpack-bot labeled #10688
  • Apr 08 19:22
    webpack-bot labeled #10688
  • Apr 08 19:22
    dependabot-preview[bot] labeled #10688
  • Apr 08 19:22

    dependabot-preview[bot] on npm_and_yarn

    chore(deps-dev): bump @types/no… (compare)

  • Apr 08 19:22
    dependabot-preview[bot] opened #10688
  • Apr 08 18:21
    sokra synchronize #7075
Evilebot Tnawi
@evilebottnawi
Maybe a lot of dependencies, hard to say without source
afrozMT
@afrozMT

/Users/afrozalam/Code/mt-coaching-ui/node_modules/@mindtickle/mt-ui-components/src/Icon/icon.config.json

this file is just a static map of constants:

{ "ADD": "add", "ADD2": "add2", "ADDCOMMENT": "addComment", "ALERT": "alert", "ANALYTICS": "Analytics", "ANNOUNCEMENT": "announcement", "ARROWUPDOWN": "arrowUpDown", "ARROWUPRIGHT": "arrowUpRight", "ASSET": "Asset", "ATTACHEMENT": "attachement", "ATTACHMENT": "attachment", "AUDIO": "audio", }

still it took 3,023 ms
Evilebot Tnawi
@evilebottnawi
maybe :smile:
afrozMT
@afrozMT
overall build time has increased, which justifies this :\
Evilebot Tnawi
@evilebottnawi
maybe you use import { something } from 'my.json'?
afrozMT
@afrozMT
yes we use this :
import ICON_MAP from './icon.config.json';
Evilebot Tnawi
@evilebottnawi
I mean named import: import { name } from 'something'
afrozMT
@afrozMT
nope we never did that.
just one instance if import
Evilebot Tnawi
@evilebottnawi
hm, need profile, it is easy and allow to solve problem fast
afrozMT
@afrozMT
do you mean CPU profile ?
Evilebot Tnawi
@evilebottnawi
no, code
will be great to look on configuration
afrozMT
@afrozMT
here is my webpack config if you want to have quick glance:
http://dpaste.com/0CJQZW5
Evilebot Tnawi
@evilebottnawi
maybe using cache-loader for css-loader can decrease compilation time (solved in webpack@5)
afrozMT
@afrozMT
Intresting part is build time is drastically reduced when using babel6 . this problem came when i updared it to babel 7
Evilebot Tnawi
@evilebottnawi
maybe some plugins very slow
afrozMT
@afrozMT
all i ran was just just babel-upgrader script
Evilebot Tnawi
@evilebottnawi
try to profile, it can solve problem
Andrew Kvapil
@viluon
Hi, is this a good place to ask for help? What I'm dealing with doesn't seem to have an answer on StackOverflow
I'm basically trying to reimplement the i18n webpack plugin with the new APIs, but the documentation seems to be lacking at best
John Marinelli
@johnmarinelli
for TerserPlugin is there a way to configure the time that a file stays in the cache ? for example, if i run a webpack build, i would want the output from Terser to be cached for 1 day
KioriSun
@KioriSun
Hey guys, with webpack, is there a way to bundle only some "ES6 imports" into a file(single build), while leaving other files as independent module scripts to be loaded at runtime?
(This is with Typescript btw)
Each of these files might or might not have their own subfolders, etc.
Gregory Danko
@g-style
Hey Guys! Is there a way to add a hash to dynamically imported chunk name?
Example: () => import(/ webpackChunkName: "MainPage.[hash]" / './Pages/MainPage');
John Marinelli
@johnmarinelli
@g-style it looks like you can only use [index] and [request]: https://webpack.js.org/api/module-methods/#magic-comments
why do you want the hash name in the file? i think webpacks' chunk manifest already covers mapping from "MyFile.js" => "MyFile.h4sh.js". my company has a special mechanism for this, so i am not sure
Rob Christian
@robchristian
I'm having trouble finding examples or docs for compiling coffeescript with modern webpack. I have a legacy project I have to support with a fair number of coffeescript files. Also, the webpack docs mention coffee-script, this module is deprecated and points to coffeescript (no hyphen)
Paul Schreiber
@paulschreiber

If I have this webpack 3 config snippet:

        new webpack.optimize.CommonsChunkPlugin({
            name: uid,
            chunks: [ 'home', 'about' ]
        })

What would be the equivalent config for optimization.splitChunks in webpack 4?

Rob
@rm-rf-etc
Uhhhgg. I can't, for the life of me, get webpack file-loader to load files!!!
ERROR in Entry module not found: Error: Can't resolve './src' in '/Users/me/projectDir'
module.exports = [{
    mode: 'production',
    module: {
        rules: [{
            test: /\.(jpe?g|gif|png|svg|woff|ttf|wav|mp3)$/i,
            loader: 'file-loader',
            options: {
                name: '[path][name].[ext]',
            },
        }],
    },
}
Rob
@rm-rf-etc
Dude, WTH?? Webpack exits with an error code, EVEN THOUGH my files copied without error. W T H.
    ERROR in Entry module not found: Error: Can't resolve './src' in '/Users/me/company/assets'
error Command failed with exit code 2.
const buildConfigs = [{
    mode: 'development',
    plugins: [
        new CopyPlugin([{
            from: path.join(__dirname, './src/images/'),
            to: path.join(__dirname, './dist/images/'),
        }]),
    ],
}
Gregory Danko
@g-style
@johnmarinelli I need the hash name because of cache on prod. Every time we update production server, dynamically imported chunks needs to be updated on our clients machines but it doesn't happens because of cache.
Diego Gullo
@bizmate
Maybe not a webpack specific question but wondering if anyone can point me in the right direction. i am running yarn encore, ... components do import react, such as import React from 'react';
How can i make it a dependency without importing it so i can require it from a cdn and keep my scripts lean?
George Maged
@grgops_gitlab

Hi guys, I'm new to webpack, and I'm developing an npm chat package. I can't figure out the correct to make an external dependency. I tried the following for the styled-components package.

externals: { "styled-components": { commonjs: "styled-components", commonjs2: "styled-components" } }

However, when I try importing the package to my main react app. styled-components is not found in my package build file. I made sure styled-components is installed on my main react app

John Marinelli
@johnmarinelli
@g-style ahh i see. i think we had that same issue, so we use our own thing for that. we were using this plugin: https://github.com/soundcloud/chunk-manifest-webpack-plugin (webpack v3)
@rm-rf-etc try running webpack with --debug and --display-error-details; https://webpack.js.org/api/cli/#debug-options
yellow1912
@yellow1912
Hi guys, is there a way to completely disable url resolving when using the sass loader? Due to the way my project is setup, all the images, fonts paths inside the scss are already resolved before passing to webpack, so running resolve again will always result in error.
I was reading about resolve-url-loader but I don't see how it can help with the problem. Basically I want no url resolving at all
Anon Ymous
@burnt.orange.cap_gitlab

Hi guys,
Presently I am writing an es6 module which I am planning to bundle with webpack. The codebase which I am working on has a large frontend es5 codebase which is bundled outside webpack. I need to be able to use the es6 modules bundled by webpack in the existing es5 codebase.

Is there a way to export modules from webpack bundles to the global namespace?

I know we can use output.library: 'MyModule' for this, but if I have 3 modules A, B and C then using MyModule.A, MyModule.B,... seems a bit clunky.

I am new to webpack (and JS, haven't really worked on the frontend before)
March Works
@MarchWorks

I would like to send build progress to browser (through webpack-dev-middleware to eventSource) but I don't know how

compiler.apply(new webpack.ProgressPlugin(function(percentage, msg) {

}));
const devMiddleware = require('webpack-dev-middleware')(compiler, {
   logLevel: 'silent',
   publicPath: '/somePath/'
})

in the browser

const sse = new EventSource('/somePath/') // not sure what I should put here
sse.addEventListener('message', event => onSseMessage(event))
Tiago Martinho
@tiagosmartinho

hello,

I am trying to load the fonts through vue.config.js. However I am not getting it.

scss

@include font-face(Lato, '/fonts/lato/latoThin', 100, normal, eot woff2 woff svg ttf);

vue.config.js

     ....
     rules: [{
                test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
                use: [{
                    loader: 'file-loader',

                    options: {
                        name: 'lato/[name].[ext]',
                        outputPath: 'fonts/'
                    }
                }]
            },

if I remove the first slash from the source path, fonts/lato/latoThin it loads the fonts, but in compile this error appears

* ./fonts/lato/latoThin.eot? in ./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-3-1!./node_modules/postcss-loader/src??ref--8-oneOf-3-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-3-3!./node_module s/resolve-url-loader!./src/styles/global.scss

and put the bar back in the font path and it works - /fonts/lato/latoThin

Any solution?

Gregory Danko
@g-style
@johnmarinelli I have found a solution. Actually there is an option for this: output.chunkFilename. So I set it to [name].[chunkhash].js and it works like a charm. Thank you anyway :)
Rob
@rm-rf-etc
@johnmarinelli thanks, that helped a bit. I have a better sense of the problem now but I'm not sure why this is happening. When I try to run a build process that isolates what I'm trying to build, it seems that webpack tries to import files that don't exist and I didn't ask it to import. Here's the error output.
ERROR in Entry module not found: Error: Can't resolve './src' in '/Users/rchristian/Company/assets'
resolve './src' in '/Users/rchristian/Company/assets'
    using description file: /Users/rchristian/Company/assets/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /Users/rchristian/Company/assets/package.json (relative path: ./src)
        no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/rchristian/Company/assets/src is not a file
        .wasm
        Field 'browser' doesn't contain a valid alias configuration
        /Users/rchristian/Company/assets/src.wasm doesn't exist
        .mjs
        Field 'browser' doesn't contain a valid alias configuration
        /Users/rchristian/Company/assets/src.mjs doesn't exist
        .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/rchristian/Company/assets/src.js doesn't exist
        .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/rchristian/Company/assets/src.json doesn't exist
        as directory
        existing directory
            using path: /Users/rchristian/Company/assets/src/index
            using description file: /Users/rchristian/Company/assets/package.json (relative path: ./src/index)
                no extension
                Field 'browser' doesn't contain a valid alias configuration
                /Users/rchristian/Company/assets/src/index doesn't exist
                .wasm
                Field 'browser' doesn't contain a valid alias configuration
                /Users/rchristian/Company/assets/src/index.wasm doesn't exist
                .mjs
                Field 'browser' doesn't contain a valid alias configuration
                /Users/rchristian/Company/assets/src/index.mjs doesn't exist
                .js
                Field 'browser' doesn't contain a valid alias configuration
                /Users/rchristian/Company/assets/src/index.js doesn't exist
                .json
                Field 'browser' doesn't contain a valid alias configuration
                /Users/rchristian/Company/assets/src/index.json doesn't exist
{
    mode: 'production',
    module: {
        rules: [{
            test: /\.s[ac]ss$/i,
            use: ['sass-loader'],
        }],
    },
}
ivan-vilches
@ivan-vilches
hello folks
i am looking for the chats for webpack community , is this active?