by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:37
    vankop edited #10953
  • 21:57
    webpack-bot unlabeled #10953
  • 21:57
    webpack-bot labeled #10953
  • 21:57
    vankop synchronize #10953
  • 20:46
    webpack-bot labeled #10976
  • 20:31
    webpack-bot labeled #10976
  • 20:31

    dependabot-preview[bot] on npm_and_yarn

    chore(deps-dev): bump @babel/co… (compare)

  • 20:31
    dependabot-preview[bot] labeled #10976
  • 20:31
    dependabot-preview[bot] opened #10976
  • 19:27
    webpack-bot labeled #10974
  • 19:26
    webpack-bot labeled #10974
  • 19:11
    sokra edited #10974
  • 19:10
    webpack-bot labeled #10974
  • 19:10
    sokra opened #10974
  • 19:10

    sokra on snapshot-dedupe

    fix lost file timestamps due to… (compare)

  • 17:17
    webpack-bot labeled #10953
  • 17:17
    webpack-bot unlabeled #10953
  • 16:57
    webpack-bot labeled #10964
  • 16:57
    webpack-bot unlabeled #10964
  • 14:09
    wizardofhogwarts review_requested #10781
Peter Müller
@Munter
https://www.npmjs.com/package/datatables.net#npm says to initialize the import result with window and jquery
Alex Barker
@kwhat
jQuery.Deferred exception: $(...).DataTable is not a function TypeError: $(...).DataTable is not a function
Myles McNamara
@tripflex
Ahhhh i see
Alex Barker
@kwhat
@Munter I tried that as well
$ not found in my other file and when it is when i do some fancy autload in mix it still comes up with the same error
Evilebot Tnawi
@evilebottnawi
You can have two jquery
Alex Barker
@kwhat
import it twice?
will webpack not pack jquery into jquery.js and datatables.js ?
Evilebot Tnawi
@evilebottnawi
Do you use CMS? WordPress include own jquery
Alex Barker
@kwhat
No this is a laravel project which is another great example of more junk tooling
They use a webpack abstraction called mix
Peter Müller
@Munter
Alex Barker
@kwhat
@Munter yes, sir. I tried this .autoload({ jquery: ['$', 'jQuery', 'window.jQuery', 'window.$'], })
Peter Müller
@Munter
These are all artifacts from quite old ways of doing modules through the global scope. That does indeed require quite some extra legwork
Alex Barker
@kwhat
and this mix.webpackConfig({ plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', 'window.$': 'jquery' }), ] });
What is "old?" We talking < 3 months?
Peter Müller
@Munter
10+ years
Evilebot Tnawi
@evilebottnawi
Why you add .autoload({ jquery: ['$', 'jQuery', 'window.jQuery', 'window.$'], })?
Alex Barker
@kwhat
Sorry, this stuff changes more regularly than my underpants and all these things I have tried are the only answers/docs I could find.
Evilebot Tnawi
@evilebottnawi
You need only ProvidePlugin
Alex Barker
@kwhat
is this ProvdePlugin different from mix.webpackConfig({ plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', 'window.$': 'jquery' }), ] });?
Peter Müller
@Munter
Do you have any way of seeing what your tool abstraction around webpack generates as its configuration for webpack? That would be useful
Alex Barker
@kwhat
When I try that webpackConfig ProviderPlugin I get "Uncaught ReferenceError: $ is not defined". Not really, not that I am aware of... This is the best you get: https://github.com/JeffreyWay/laravel-mix/tree/master/src
Evilebot Tnawi
@evilebottnawi
I think reproducible test repo help to solve problem
Alex Barker
@kwhat
Yah, I think going back to C is probably a better long term solution. The last 3 years have really just destroyed everything I have ever enjoyed about development.
It seems to just get more and more complex with a lot of on paper benefits that never materialize. You guys seem to enjoy this stuff, so please keep it. It makes the rest of us want to kill ourselves.
Peter Müller
@Munter
Dude, the reason this is hard is that you are using libraries from before the dependency graph era. Everybody struggles getting 10 year old tech to work
The need for the amd override surprised me
Harimau melaya
@HarimauApapap_twitter
Hi
afrozMT
@afrozMT

Hi

I am using speed-measure plugin to investigate long build time taken by webpack.
Unable to figure what is it which is taking time. Here is the snapshot of timing returned by speed measure plugin:

`
SMP ⏱
General output time took 61,459 ms

SMP ⏱ Plugins
HtmlWebpackPlugin took 1,492 ms
CircularDependencyPlugin took 510 ms
DefinePlugin took 1 ms

SMP ⏱ Loaders
modules with no loaders took 56,412 ms
median = 296 ms
mean = 306 ms
s.d. = 298.099 ms
range = (0 ms --> 3,023 ms)
module count = 3538
/Users/afrozalam/Code/mt-coaching-ui/node_modules/@mindtickle/mt-ui-components/src/Icon/icon.config.json = 3,023 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/rc-tween-one/es/plugin/StylePlugin.js = 2,795 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/rc-calendar/lib/date/DateTHead.js = 2,728 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/rc-calendar/lib/date/DateTBody.js = 2,726 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/@babel/runtime/helpers/toConsumableArray.js = 2,508 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/@babel/runtime/helpers/objectWithoutProperties.js = 2,503 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/whatwg-fetch/fetch.js = 2,286 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/@babel/runtime/helpers/slicedToArray.js = 2,208 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/intersection-observer/intersection-observer.js = 2,057 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/styled-components/dist/styled-components.browser.esm.js = 1,908 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/store/src/util.js = 1,889 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/redux-batched-actions/lib/index.js = 1,889 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/react/cjs/react.development.js = 1,393 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/html-entities/lib/html5-entities.js = 1,354 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/html-entities/lib/html4-entities.js = 1,333 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/@sentry/utils/misc.js = 1,333 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/html-entities/lib/xml-entities.js = 1,330 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/core-js/modules/_array-species-constructor.js = 1,308 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/core-js/modules/_is-object.js = 1,272 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/react-intl/locale-data/tr.js = 1,270 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/react-intl/locale-data/ts.js = 1,269 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/react-intl/locale-data/to.js = 1,267 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/ramda/es/whereEq.js = 1,265 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/ramda/es/without.js = 1,264 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/ramda/es/zip.js = 1,263 ms
/Users/afrozalam/Code/mt-coaching-ui/node_modules/ramda/es/xprod.js
`

I am using latest webpack version. I am unable to infer what it is for webpack for load a module when there is no loader/plugin involved.
Evilebot Tnawi
@evilebottnawi
A lot of modules without loaders took 56,412 ms
afrozMT
@afrozMT
Yes, thats what i am trying to undestand
when there is no loader involved, what is it webpack taking time then ?
Evilebot Tnawi
@evilebottnawi
on parsing import/export/require/module.exports
afrozMT
@afrozMT
OKay, so what could be reason(s) for such erroneous time. Any pointer ?
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 ?