Comments (12)
finally we found the actual error.
from grunt-webpack.
@anbaran have you not found the actual bug either?
from grunt-webpack.
the problem is that we cant even see it touch grunt-webpack, thats the problem.
from grunt-webpack.
No, i didnt investigate it deeper. Look at the demo app. The compilation works when run directly in webpack and it fails if grunt-webpack is used. So I assume it is grunt-webpack problem. I didn't have time (and knowledge) so far to analyse why exactly grunt-webpack fails. Do you have any new details?
from grunt-webpack.
yeah i started looking at, because it is totally because of this and the program is not so big so i could catch the error.
from grunt-webpack.
for now, i created a grunt task
that actually works:
grunt.registerTask('grunt-webpack-build', function() {
const done = this.async();
const exec = require('child_process').exec;
let configFile
// you can change the webpack config file with some if....
configFile = `${__dirname}/webpack.config.js`
const run = exec(`./node_modules/.bin/webpack-cli --production --config ${configFile}`, {
stdio: 'inherit',
shell: true,
customFds: [0,1,2],
}, (e, stdout, stderr) => {
if (e) {
done(e);
return
}
done();
});
run.stdout.on('data', (data) => {
grunt.log.write(data)
});
run.stderr.on('data', (data) => {
grunt.log.write(data)
});
})
from grunt-webpack.
Ok great, I will test it this week
from grunt-webpack.
Hello,
I just tried your solution but I receive the following error, do you know what is going on there?
Warning: Command failed: ./node_modules/.bin/webpack-cli --production --config <project-location>ngtools-webpack-error/webpack.config.js
<project-location>/ngtools-webpack-error/node_modules/webpack-cli/bin/cli.js:291
const statsPresetToOptions = require("webpack").Stats.presetToOptions;
^
TypeError: Cannot read property 'presetToOptions' of undefined
at processOptions (<project-location>/ngtools-webpack-error/node_modules/webpack-cli/bin/cli.js:291:57)
at yargs.parse (<project-location>/ngtools-webpack-error/node_modules/webpack-cli/bin/cli.js:536:3)
at Object.parse (<project-location>/ngtools-webpack-error/node_modules/webpack-cli/node_modules/yargs/yargs.js:563:18)
at <project-location>/ngtools-webpack-error/node_modules/webpack-cli/bin/cli.js:219:8
at Object.<anonymous> (<project-location>/ngtools-webpack-error/node_modules/webpack-cli/bin/cli.js:538:3)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:279:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:696:3)
Use --force to continue.
from grunt-webpack.
first, make sure it works with CLI, eg:
webpack --production --config <config-path-file>
then it will work with the grunt task as well, for sure. basically, it is the same execution.
from grunt-webpack.
been using it the way you told me and i created a grunt task that actually uses the webpack cli from a config file...
from grunt-webpack.
@anbaran have you created the config file? configFile = __dirname + '/webpack.config.js'
?
from grunt-webpack.
@p3x-robot p3x-robot Sorry I didn't answer you yet but I am busy in a different area, I will let you know soon
from grunt-webpack.
Related Issues (20)
- webpack-dev-server cannot get port HOT 1
- grunt webpack-dev-server cannot get port HOT 1
- grunt-webpack doesn't work with next version of webpack-dev-server 3.x.x HOT 3
- add support for webpack v4 HOT 1
- Webpack 4: Tapable.apply is deprecated
- webpack.BannerPlugin improperly evaluated since upgrading to Webpack 4 HOT 3
- Cannot convert undefined or null to object HOT 2
- How to force production mode without build access HOT 6
- Error: Cannot find module 'webpack-dev-server/lib/util/createDomain' HOT 3
- SplitChunks cacheGroups test callback function does not work with grunt webpack HOT 3
- AngularCompilerPlugin Circular reference detected HOT 1
- HotModuleReplacementPlugin is added twice with webpack-dev-server >= 3.2.0 HOT 3
- hangs in the docker container in Jenkins pipeline HOT 1
- Does not support multiple targets HOT 1
- webpack 5 upgrade HOT 1
- webpack 5 deprecation warning HOT 21
- grunt-webpack with webpack 5.x HOT 3
- Cannot find module 'webpack-dev-server/lib/util/createDomain' with webpack-dev-server v4 HOT 1
- ost:3000
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 grunt-webpack.