Comments (7)
Hi, you are totally correct both with the core concept and lacking documentation. :/ Sorry about that!
We generate build.log
using gulp-webpack
in our gulp task:
import fs from 'fs';
import gulp from 'gulp';
import gutil from 'gulp-util';
import webpack from 'gulp-webpack';
import revision from 'git-rev';
import configFactory from "./webpack-production.config.js";
const VERSIONS = ['editor', 'viewer'];
let running = 0;
function allFinishedCallback(callback) {
running--;
if (running < 1) { callback(); }
}
gulp.task('webpack', callback => {
revision.short(rev => {
VERSIONS.forEach(version => {
gutil.log('Building version', version);
const config = configFactory({
revision: rev,
// ...other props...
}, version);
running++;
gulp.src('src/js/app.js')
.pipe(webpack(config, null, (err, stats) => {
if (!err) {
fs.writeFileSync(`build.${version}.log`, stats.toString());
console.log('Build', version, stats.hash, 'done.');
}
}))
.pipe(gulp.dest('dist/assets/'))
.on('end', allFinishedCallback.bind(this, callback));
});
})
});
Build log is basically the output of webpack build task:
Hash: c00ad65585e3907e0eaf
Version: webpack 1.12.12
Time: 250760ms
Asset Size Chunks Chunk Names
46a42a2968ec13389ecd8f0693c39f2d.png 4.08 kB [emitted]
ec6e7bba569b5ad40e3c55a09e2c4536.svg 71.3 kB [emitted]
48a5db854d708f87e08becc002eb2397.png 6.7 kB [emitted]
d1e5ba5eac8d1a3ab0692ffe8eac5f1f.png 13.7 kB [emitted]
aa8a31e5a6f9bba6678858f5db6bcf15.png 3.49 kB [emitted]
c62d3bb14c81b4e6d0aac9a9492a6b8d.png 6.14 kB [emitted]
... and so on ...
from webpack-deploy.
I am planning to somehow get rid of the build hash dependency, but haven't found any easy way to do that yet.
from webpack-deploy.
Thanks for the reply. Just of curiosity, what do you use the git revision for in configFactory?
from webpack-deploy.
We bake it into the build as a constant. That way the runtime knows which version it is running.
from webpack-deploy.
@espenhogbakk Any luck with the setup?
from webpack-deploy.
Made it work, but required some hacking here and there.
from webpack-deploy.
Glad to hear! I will make some improvements soon as we have some new
requirements in our team.
On Tue, Jun 7, 2016 at 1:15 PM Espen Høgbakk [email protected]
wrote:
Made it work, but required some hacking here and there.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#24 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAIkaUMZphQdOcccjbVwzPZzSACaItL4ks5qJVLMgaJpZM4HvNFq
.
from webpack-deploy.
Related Issues (8)
- Commands not found HOT 3
- Broken backward compatibility with one file deploys
- List revs task not compatible with multiple app version config HOT 1
- Source maps shouldn't be required HOT 3
- npm ERR! missing script: deploy-s3 HOT 2
- The major refactor for a new shiny look
- Remove productboard code references
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-deploy.