Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:58
    webpack-bot labeled #10080
  • 10:58
    webpack-bot unlabeled #10080
  • 10:43
    sokra synchronize #10080
  • 10:43

    sokra on cjs-tree-shaking

    fix Errors for require.parent/m… (compare)

  • 09:48
    webpack-bot labeled #10083
  • 09:33
    webpack-bot labeled #10083
  • 09:33
    aboks opened #10083
  • 08:41
    evilebottnawi reopened #10044
  • 08:41
    evilebottnawi closed #10044
  • Dec 04 22:28
    webpack-bot labeled #10080
  • Dec 04 22:18
    webpack-bot labeled #10080
  • Dec 04 22:18
    sokra opened #10080
  • Dec 04 22:06

    sokra on cjs-tree-shaking

    Refactor how exportsType work a… (compare)

  • Dec 04 21:57

    sokra on cjs-tree-shaking

    remove module.id and loaded sho… add some test cases for cjs tre… fixup test cases and 3 more (compare)

  • Dec 04 12:35
    sokra synchronize #7075
  • Dec 04 12:35

    sokra on master

    chore(deps-dev): bump typescrip… Merge pull request #10077 from … (compare)

  • Dec 04 12:35

    sokra on npm_and_yarn

    (compare)

  • Dec 04 12:35
    sokra closed #10077
  • Dec 04 09:17
    webpack-bot labeled #10077
  • Dec 04 09:00

    dependabot-preview[bot] on npm_and_yarn

    chore(deps-dev): bump typescrip… (compare)

Jake
@JakeDVirus
This message was deleted
Jake
@JakeDVirus
how can i export the below code script and import in another js file using es6 import/export
 window.onscroll = function() {

    /*######################################################
    ###               HEADER                           #####
    #######################################################*/

    /*===(1)=======================================================
        Making .row-navigation sticky when scrolled (fixed position)
    ===============================================================*/
    var rowNavigation = document.querySelector('.container-header .row-navigation');
    var rowWelcome = rowNavigation.previousElementSibling;
    var rowWelcomeHeight = rowWelcome.offsetHeight;

    var nextDomElement = rowNavigation.parentElement.nextElementSibling;

    if (window.pageYOffset > rowWelcomeHeight ) {
      rowNavigation.classList.add('sticky');
      nextDomElement.style.paddingTop = rowNavigation.offsetHeight + "px";
    } else {
      rowNavigation.classList.remove('sticky');
      nextDomElement.style.paddingTop = "0px";
    }





  }// end of onscroll function
when i try to export using export window.onscroll = . . . it doesn't allow because export expect a statement or declaration
can i import the whole code in the file (like concanating in the another file)
Simon
@simonhowey
export const windowScroll = () => { yourcodehere } You also might want to use the scroll event vs window.onscroll. You can only have one onscroll afaik. https://developer.mozilla.org/en-US/docs/Web/API/Document/scroll_event
plastikfan
@plastikfan

Hi, I'm having problems using webpack & typescript, particularly making sure generated declaration files are included inside the WP generated bundle. How do I do this? The entry point in webpack config is:

    entry: {
      index: './lib/index.ts'
    },

and in tsconfig.json

    "declaration": true,
    "types": [
      "mocha", "node"
    ],

I'm getting confused by the offical documentation. This is for a nodejs application not browser. I also need to know how to consume the types from such a project from another typescript project. Ta

emilmuller
@emilmuller
@plastikfan are you using babel?
plastikfan
@plastikfan
no webpack/typescript and goinf round in circles :(
Jonatan Brager Sidén
@bragjo

Hey guys, new guy here. So glad I found out about Gitter! fun times.

I'm currently working on a simple web project (just a simple html css classic js project, nothing fancy at all). I'm trying to setup webpack for hot module replacement using webpack-dev-server but I want to instead use express for my dev server.. does anyone here have an easy way to do this? it would be amazing to get going with this. Thanks alot!

Suen
@sunzongzheng
Anybody know what is the right way to modify module result? I tried to modify module._source._value in finishModules hooks, but the result turns to strange
image.png
strange means the content in result's eval can not run,like this
image.png
Jonatan Brager Sidén
@bragjo
when installing webpack, would u install webpack webpack-cli webpack-dev-server as dev-dependencies or just normal dependencies? I’m following a tutorial where he installs it using -S (which I THINK is the equalent of —save right?)
correct me if I’m wrong - but to me it makes more sense to use webpack-dev-server only for dev purposes, while webpack and webpack-cli can be used for production, am I wrong?
Evilebot Tnawi
@evilebottnawi
dev dependencies
Mike S
@miansc94_twitter
hello. does anyone have experience with using HMR on proxied sites?
pm if you can help setup HMR for shopify ($$) :)
Jonatan Brager Sidén
@bragjo
@evilebottnawi I had to install webpack-dev-server globally for it to work at all
Evilebot Tnawi
@evilebottnawi
don't do it
install always locally
globally installation is bad practice
Jonatan Brager Sidén
@bragjo
but if I dont install it globally it doesnt work at all
even if I install it as a dev dep or normal dep
Evilebot Tnawi
@evilebottnawi
should work, because it is work for 3 millions of developers :smile:
Jonatan Brager Sidén
@bragjo
when googling it, they do suggest me to install it globally
Evilebot Tnawi
@evilebottnawi
i don't recommended do it as developer of webpack-dev-server
Jonatan Brager Sidén
@bragjo
okay hmm.. when installing it locally it says ”no such command"
Evilebot Tnawi
@evilebottnawi
node_modules/.bin/webpack-dev-server use
or put "start": "webpack-dev-server"in scripts in package.json
Jonatan Brager Sidén
@bragjo
Im running webpack-dev-server config=config/webpack.dev.config.js
D[oa]vid Weisz
@dovidweisz
@JonatanSiden when you install it locally it creates an executable file in node_modules/.bin
Jonatan Brager Sidén
@bragjo
so how do I run it after installing it locally as a dev dev?
D[oa]vid Weisz
@dovidweisz
you can execute it with yarn {PACKAGE_NAME}
Jonatan Brager Sidén
@bragjo
I saw some tutorial where he installed it using npm install webpack-dev-server -S and then he could run it - mine is not the case
D[oa]vid Weisz
@dovidweisz
or npm run ...
Jonatan Brager Sidén
@bragjo
but that would require me to include it in a script in my package.json right?
D[oa]vid Weisz
@dovidweisz
um tes
Jonatan Brager Sidén
@bragjo
he did not do that, thats why im confused :D he just ran webpack —config=config/webpack.config.js
D[oa]vid Weisz
@dovidweisz
it would be added automatically
if you don't want to install in in you app you can always use npx
npx will download the package and run it on the fly
npm will update the package.json file for you
D[oa]vid Weisz
@dovidweisz

@JonatanSiden

but that would require me to include it in a script in my package.json right?

Oh i misunderstood you here

I'm pretty sure you don't need to add a "script" to the package.json
all executables in node_modules/.bin can be run with npm run
Jonatan Brager Sidén
@bragjo
@dovidweisz do u usually install webpack with —save-dev or just the webpack-dev-server ?
D[oa]vid Weisz
@dovidweisz
I guess I do
but it really doesn't matter unless you're publishing a module to NPM
Jonatan Brager Sidén
@bragjo
okay, thanks