Webpack Tutorial - Replace Gulp/Grunt plugins with a single tool

Webpack Tutorial - Replace Gulp/Grunt plugins with a single tool

LearnCode.academy

8 лет назад

366,404 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@KevinhoKO
@KevinhoKO - 30.03.2017 10:35

you are talking in a similar way like donald trump

Ответить
@snehavantamuri6241
@snehavantamuri6241 - 31.03.2017 10:13

When I try to open webpack.config.js using touch command as u mentioned, it says "touch is not recognized as internal or external command". Pls anyone who knows can reply n help

Ответить
@jordanneeb447
@jordanneeb447 - 07.04.2017 03:53

TypeError: webpack.optimize.OccurenceOrderPlugin is not a function

Ответить
@Evgeniy4063
@Evgeniy4063 - 08.04.2017 11:54

After webpack build jquery is still available on my page with "$.fn.jquery" in the console - did I do something wrong?

Ответить
@AlanSmithofficial
@AlanSmithofficial - 11.04.2017 20:28

I know I could just create the webpack.config.js file myself but what is the windows command prompt equivalent to 'touch webpack.config.js' ?

Ответить
@AnishKumar-kf9xe
@AnishKumar-kf9xe - 12.04.2017 21:18

To me its showing that "npm should run outside of the node repl, in your normal shell" whenever I am using the npm command in the node. Can't move forward :(

Ответить
@luismuzquiz1400
@luismuzquiz1400 - 13.04.2017 19:58

You kind of sound like the wolf of wallstreet actor Jonah Hill

Ответить
@FF2PM
@FF2PM - 25.04.2017 09:20

I planned to learn React after learning your JS tutoria. Moved here and I am completely lost.

Any tip guys?

Ответить
@ishdanbiketto3178
@ishdanbiketto3178 - 29.04.2017 02:11

yes

Ответить
@LondonAppDeveloper
@LondonAppDeveloper - 03.05.2017 09:30

This is really useful. I recently started learning ReactJS and I was a bit confused as to what is happening behind the scenes. This video explained it perfectly.

Ответить
@eshwarenmanoharen870
@eshwarenmanoharen870 - 26.05.2017 10:45

If you are watching this after 26th May 2017, please use this config file instead.


var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');

module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : false,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
},
plugins: debug ? [] : [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
],
};



Why? Because this tutorial is on Webpack 1. We just need to tweak slightly to make it work with Webpack 2.
Changes
--------------

1. debug ? "inline-sourcemap" : false, <-- used to be null
2. removed dedupe plugin - it's no longer needed.

Hope this helps.

Ответить
@ColacX
@ColacX - 24.06.2017 23:18

where is the html files? make the guide include them. how to make them go into dist folder?

Ответить
@goodwish1543
@goodwish1543 - 21.07.2017 07:34

Works !

Ответить
@SergeiKjtydghk
@SergeiKjtydghk - 21.07.2017 12:36

haha, "If I Could Turn Back Time" - nice, thanks dude for the video

Ответить
@curtturdle5661
@curtturdle5661 - 25.07.2017 22:32

i hate your text editor. the document tree is too hard to decipher

Ответить
@omphaluskua3249
@omphaluskua3249 - 27.07.2017 13:09

awesome dude

Ответить
@brandonwillis6306
@brandonwillis6306 - 01.08.2017 07:37

"NODE_ENV=production webpack" not work for anyone else?

Ответить
@raj080288
@raj080288 - 14.08.2017 14:05

can the AMD be used in webpack 2?

Ответить
@naseefo
@naseefo - 18.08.2017 21:26

I am having error when I write: NODE_ENV=production webpack

I am running windows 64-bit. From stackoverflow I had learned that to set the environment variable I would need to write

set NODE_ENV=production, Enter [this is coming out okay]
webpack, Enter [When I click enter it throws up an error]

Ответить
@AS-gh1zx
@AS-gh1zx - 27.08.2017 11:53

Excellent tutorial, but why did you install webpack twice?

Ответить
@urvirathod7031
@urvirathod7031 - 28.08.2017 10:04

Hey there..I've installed webpack using npm -g install webpack. But while running webpack it is showing that command not found. Also when I use npm list webpack, then it is showing the correct location. But not working with webpack command. Kindly help, I am a beginner with React js. Thanks.

Ответить
@priyatyagi9957
@priyatyagi9957 - 25.09.2017 21:18

I have a question which I have asked several times but have received no solution at all. I hope this helps. So I have 2 folders in my src. app/ and js/. My app folder comprises of my react code and js/ basically comprises of my js code like jQuery, few plugins and other functionality codes. When using which I wanna keep each of these js codes from bundling i.e I don't want any of my code in js/ bundled instead just copied from src to dist folder. I am seriously in need of solution here guys coz all of this excluding the react part was a lot lot simpler with gulp. But just to learn a new tech I decided to make a switch to webpack. Please guys ... Thanks

Ответить
@JeffDZ40
@JeffDZ40 - 04.10.2017 21:55

Hi guys, this may seem to be a rookie question, but i actually do not know the tool that is being used in the npm examples. Is he using node.js command prompt, regular command prompt or what exactly. Also, how did the instructor connect his sublime text to the terminal where commands are being run? N00b here.

Ответить
@LanguageSkillz
@LanguageSkillz - 31.10.2017 18:12

jquery remains strong preference.

Ответить
@fengfeng6680946
@fengfeng6680946 - 13.11.2017 02:17

what is the theme are you using in the sublime text 3? It looks really nice.

Ответить
@sprasain1
@sprasain1 - 17.11.2017 06:29

Great Tutorial !

Ответить
@cerebraldatajack4994
@cerebraldatajack4994 - 28.11.2017 16:42

Thank you. One bit of feedback though.. Installing webpack globally is recommended against by the documentation.

Ответить
@bishop9779
@bishop9779 - 30.11.2017 01:57

OccurenceOrderPlugin has been renamed to OccurrenceOrderPlugin.

Ответить
@Ronirvan
@Ronirvan - 24.12.2017 06:00

This NODE_ENV=production webpack does not work here. It gives an error message regarding this and I don't know why.

Ответить
@SgtThiel
@SgtThiel - 25.12.2017 15:16

2017-12-25
* new webpack.optimize.OccurrenceOrderPlugin* Occurrence with 2 "r"
* devtool: debug ? "inline-sourcemap" : false* devtool accepts strings or false

Ответить
@reyou7
@reyou7 - 21.01.2018 01:53

Amazing tutorial thanks! But gist needs to be updated for WebPack 2 version.

Ответить
@alejandroelara
@alejandroelara - 27.01.2018 05:49

I'm getting this error, little help please,

TypeError: webpack.optimize.OccurenceOrderPlugin is not a constructor

Ответить
@MrGeekGamer
@MrGeekGamer - 22.03.2018 16:12

Non working Node tutorial #4522897. Great job.

Ответить
@rogadev
@rogadev - 05.04.2018 22:21

it would be immensely useful if I could see how you set up Sublime Text. My default view looks nothing like this, and in other videos I've learned how to use different software. I like the look of this application though and I'd love to see the basic run-through (so save myself time figuring it out on my own) of how you got from install to this starting view. From there the Webpack video would make much more sense. Thanks.

Ответить
@Rugit0
@Rugit0 - 24.04.2018 22:28

To get mine to work I had to
npm install -g webpack-cli

and change the line in the webpack.config.js:
entry: "./js/scripts.js",
to
entry: __dirname + "/js/scripts.js",
or I would get the following error
ERROR in Entry module not found: Error: Can't resolve './src' in 'C:\Users\admin\Documents\node\webpack2'

Ответить
@jessicathedoc8569
@jessicathedoc8569 - 29.04.2018 00:32

wow. mind-blowing.

Ответить
@EdwardRamkissoonIRL
@EdwardRamkissoonIRL - 13.06.2018 21:34

Hey dude, these vids are super helpful! I'm building my first app with React, and your vids are coming in very handy.

Ответить
@wepranaga
@wepranaga - 25.06.2018 09:07

cool. thanks

Ответить
@davidbond7195
@davidbond7195 - 25.06.2018 21:25

When i try to run the webpack command it says I need a webpack CLI

Ответить
@hk_build
@hk_build - 12.07.2018 11:05

When I use create react app and npm start will host app on browser.. When I install web pack-dev-server then if I hit cmd npm start it won't host app in browser.. What is reason

Ответить
@asdfasdfuhf
@asdfasdfuhf - 28.07.2018 16:15

You have a beautiful singing voice

Ответить
@anujmishra4013
@anujmishra4013 - 26.09.2018 11:19

can you make video on debugging as well

Ответить
@JavedKhalil
@JavedKhalil - 06.11.2018 07:36

Thank you

Ответить
@dimitarvel1441
@dimitarvel1441 - 26.11.2018 00:24

Being the sucker for vanilla JavaScript I am, I still use only 1 just file, unless I have an universal nav that is same on every page, then I make another js file for the nav.

Ответить
@Maikshifter
@Maikshifter - 05.09.2023 08:39

Thanks for your tutorials. I found I had to install and pin version 4 of webpack/cli (eg npm install --save-dev webpack@4 webpack-cli@4) and I had to set an environment variable (set NODE_OPTIONS=--openssl-legacy-provider) so that node provided what webpack v4 was requiring..
Then I had to also add the following to the webpack.config.js
mode: debug ? "development" : "production",
It has been 7 years since this video was made, after all.

Ответить