We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't seem to get this to compile a file stream with webpack 5
webpack 4 works fine, on my current node version (16) but I need to update to node 18 and must update to webpack 5
gulpfile.js
const WP_THEME = 'bespoke-theme'; const THEMEPATH = 'public/content/themes/' + WP_THEME; /* Needed gulp config */ const { series, src, dest, watch } = require('gulp'); const sass = require('gulp-sass')(require('node-sass')); const env = require('minimist')(process.argv.slice(2)); const named = require('vinyl-named'); const uglify = require('gulp-uglify-es').default; const plumber = require('gulp-plumber'); const webpack = require('webpack-stream'); /* javascripts task */ async function javascript () { var scripts = src([ THEMEPATH + '/assets/javascript/main.js' ]) .pipe(plumber()) .pipe(named()) .pipe(webpack({ mode: env.production ? 'production' : 'development', externals: { jquery: 'jQuery', }, })); if(env.production) { scripts = scripts.pipe(uglify()); } return scripts .pipe(dest(THEMEPATH + '/dist/js')); } exports.javascript = javascript;
package.json
{ "private": true, "version": "1.0.0", "description": "", "main": "gulpfile.js", "devDependencies": { "gulp": "^4.0.1", "gulp-css-useref": "^0.0.1", "gulp-cssmin": "^0.2.0", "gulp-plumber": "^1.1.0", "gulp-resolve-url": "^0.0.2", "gulp-sass": "^5.0", "gulp-sourcemaps": "^3.0", "gulp-uglify-es": "^3.0", "minimist": "^1.2.7", "vinyl-named": "^1.1.0", "vinyl-source-stream": "^2.0", "node-sass": "^6.0.1", "webpack-stream": "^7.0", "webpack": "^5.75" }, "dependencies": { "bootstrap": "^5.1", "@fortawesome/fontawesome-free": "^6.1.0", "jquery": "^3.2.1", "@popperjs/core": "^2.10.2" }, "scripts": { "dev": "gulp", "development": "gulp", "watch": "gulp watch", "production": "gulp --production" } }
The text was updated successfully, but these errors were encountered:
It seems that if i take all "require"'s out of the target file it compiles but don't work without those libraries
The stream isn't providing any helpful errors
main.js
window.$ = window.jQuery = require('jquery/src/jquery'); import * as bootstrap from 'bootstrap';
Sorry, something went wrong.
No branches or pull requests
I can't seem to get this to compile a file stream with webpack 5
webpack 4 works fine, on my current node version (16) but I need to update to node 18 and must update to webpack 5
gulpfile.js
package.json
The text was updated successfully, but these errors were encountered: