Skip to content

Instantly share code, notes, and snippets.

@dcvezzani
Created January 19, 2018 16:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dcvezzani/bb535a2236ef160b0769b86ec10e526b to your computer and use it in GitHub Desktop.
trying to understand what is responsible for webpack/babel compressing code
{
"name": "asdf4",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack -p",
"watch": "webpack --watch"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^3.10.0"
},
"dependencies": {
"css-loader": "^0.28.9",
"moment": "^2.20.1",
"style-loader": "^0.19.1"
}
}
var path = require('path');
module.exports = {
entry: './assets/js/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.css$/, // Run the loader on all .js files
exclude: [/node_modules/], // ignore all files in the node_modules folder
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
]
}
]}
};
➜  asdf4 npm run build

> asdf4@1.0.0 build /Users/dcvezzani/projects/asdf4
> webpack -p

Hash: cbcfcbc0dad87a48a529
Version: webpack 3.10.0
Time: 4382ms
    Asset    Size  Chunks             Chunk Names
bundle.js  234 kB       0  [emitted]  main
 [120] ./assets/js/index.js 118 bytes {0} [built]
 [121] ./assets/js/greeter.js 161 bytes {0} [built]
 [122] (webpack)/buildin/module.js 517 bytes {0} [built]
 [123] ./node_modules/moment/locale ^\.\/.*$ 2.88 kB {0} [optional] [built]
 [124] ./assets/css/styles.css 1.02 kB {0} [built]
 [125] ./node_modules/css-loader!./assets/css/styles.css 188 bytes {0} [built]
    + 123 hidden modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment