webpack/examples/persistent-caching/README.md

43 lines
845 B
Markdown
Raw Normal View History

2018-10-09 20:30:59 +08:00
# example.js
2019-05-10 03:34:28 +08:00
```javascript
2018-10-09 20:30:59 +08:00
console.log(process.env.NODE_ENV);
import "react";
import "react-dom";
import "acorn";
import "core-js";
import "date-fns";
```
# webpack.config.js
2019-05-10 03:34:28 +08:00
```javascript
2018-10-09 20:30:59 +08:00
const path = require("path");
module.exports = (env = "development") => ({
mode: env,
infrastructureLogging: {
level: "verbose"
},
2018-10-09 20:30:59 +08:00
cache: {
type: "filesystem",
// changing the cacheDirectory is optional,
// by default it will be in `node_modules/.cache`
cacheDirectory: path.resolve(__dirname, ".cache")
2018-10-09 20:30:59 +08:00
}
});
```
# Info
```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack 5.0.0-alpha.19
2018-10-09 20:30:59 +08:00
Asset Size Chunks Chunk Names
2019-05-10 03:34:28 +08:00
output.js 1.78 MiB {0} [emitted] main
2018-10-09 20:30:59 +08:00
Entrypoint main = output.js
2019-08-05 19:32:25 +08:00
chunk {0} output.js (main) 1.54 MiB (javascript) 1.07 KiB (runtime) [entry]
2019-02-05 01:52:39 +08:00
> ./example.js main
2019-05-10 03:34:28 +08:00
526 chunk modules
2018-10-09 20:30:59 +08:00
```