It seems sails-webpack does not reproduce what grunt hook does (clean, uglify, etc), so I'd suggest using
grunt-webpack instead. This way you only add the necessary grunt task to the default sails assets pipeline by configuring it in tasks/config/webpack.js and registering that in tasks/register/compileAssets.js.
A typical tasks/config/webpack.js would look like this (referred to as 'webpack:build' in compileAssets.js):
module.exports = function(grunt) {
var webpackConfig = require("../../webpack.config.js");
grunt.config.set('webpack', {
options: webpackConfig,
build: {
}
});
grunt.loadNpmTasks('grunt-webpack');
};
You can specify your webpack options inline instead of requiring an external webpack.config.js, see the grunt-webpack documentation for details. Just make sure you install the required babel/webpack/loader packages along with
the proper .babelrc configuration file in the root of your sails project. Also, you need to set the output path according to what sails expect, i.e. either assets/js/ (allow sails-linker to process the built js) or .tmp/public/js/ (don't link anything and include manually).
This approach relies on bundling the various js files you need with webpack when lifting your sails app, and does not support webpack-dev-server / hot module reloading (HMR). This would require messing with sails.config.http.middleware to include something like
webpack-dev-middleware or somehow starting the webpack dev server on another port and using
express-http-proxy. I did get this to work by having two separate projects (sails backend / vue frontend) and starting it with a Procfile, but I'm still looking for a cleaner way to integrate HMR more tightly with sails (better handling of default 403/404/500 views for example).
Hope this helps, I'll try updating this thread as I make progress towards integrating HMR.