➜ 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
/01.package.json Secret
Created
January 19, 2018 16:37
Star
You must be signed in to star a gist
trying to understand what is responsible for webpack/babel compressing code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' } | |
] | |
} | |
]} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment