webpack / webpack-with-common-libs Goto Github PK
View Code? Open in Web Editor NEWwebpack with some common libraries
License: MIT License
webpack with some common libraries
License: MIT License
Says:
Warning: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry should be one of these:
object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
The entry point(s) of the compilation.
Details:
* configuration.entry should be an object.
* configuration.entry should be a string.
* configuration.entry[1] should be a string.
* configuration.entry should be an instance of function
function returning an entry object or a promise.. Use --force to continue.
webpack config has entry: property, works via npm scripts
Using Webpack 3
The webpage "plugins" for gulp state, "No need for a gulp plugin. Just use webpack directly." but your examples don't just use WebPack directly, they miss out on the point of Gulp entirely.
For example, this is how I use Browserify:
gulp.src('./scripts/index.js', {read: false})
.pipe(browserify({
insertGlobals: false,
debug: true,
transform: ['uglifyify'],
'global-transform': true
}))
.pipe(rename('speech.js'))
.pipe(gulp.dest('./spx/meta/'));
This is how I setup Google Closure:
gulp.src('./babel/babel.js')
.pipe(closure({compilation_level: 'ADVANCED_OPTIMIZATIONS'}))
.pipe(rename('babel.mini.js'))
.pipe(gulp.dest(location));
gulp.src('./babel/babel.js')
.pipe(closure({compilation_level: 'ADVANCED_OPTIMIZATIONS'}))
.pipe(zip())
.pipe(rename('babel.mini.js.gz'))
.pipe(gulp.dest(location));
Here is how I am supposed to use Web Pack with Gulp:
gulp.task("webpack", function(callback) {
// run webpack
webpack({
// configuration
}, function(err, stats) {
if(err) throw new gutil.PluginError("webpack", err);
gutil.log("[webpack]", stats.toString({
// output options
}));
callback();
});
});
The // configuration
shows that you are missing the point of Gulp: code over configuration. If you are asking me to write a bunch of foreign config then you obviously "need a plugin" because I don't want to "use Web Pack directly". I want to pass it files using a pipe and I want to direct the output to files but your examples don't tell me how to do that.
If I just wanted a task runner, I could use Grunt or WebPack directly. I choose Gulp because it makes it easier for me to iteratively build up a large number of tasks.
Usual gulp tasks pipe files allowing me to trigger a reload at the end. How could that be applied using the following snippet from your sample files:
gulp.task("webpack:build-dev", function() {
// run webpack
devCompiler.run(function(err, stats) {
if(err) throw new gutil.PluginError("webpack:build-dev", err);
gutil.log("[webpack:build-dev]", stats.toString({
colors: true
}));
});
});
It is myConfig.devtool = "sourcemap"
.
But I have seen in webpack docs it is source-map
They are different all right? It doesn't matter?
I'm struggling with webpack and karma, and an example of those w/mocha would be most appreciated.
DOM and mocha aren't guaranteed, and thats why webpack helps us, build bundles from typically node code (require) etc, mocha uses (describe) and I had an epihany earlier today which I can't get working again: Hot reloading with the mocha-loader.
Will attempt to PR this likely through an npm run-script
like:
webpack-dev-server "mocha\!./test/index.js" --inline --hot [--output-file file]
Note, just today I realized that with --output-file testBundle.js (for example) you would browse to http://localhost:8080/testBundle and see the mocha html runner spun up and updating in place.
It was glorious -- link forthcoming if i can achieve that with karma start or something. I think maybe including the test suite in iframe mode would be helpful. I just want a way to get TestUtils.RenderIntoDocument working the simplest possible way in a test suite.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.