caiobiodere / cordova-template-framework7-vue-webpack

Framework7 - Vue - Webpack Cordova Template with Webpack Dev Server and Hot Module Replacement
Apache License 2.0
620 stars 154 forks source link

Error for cordova build browser --release #178

Closed i-no closed 4 years ago

i-no commented 5 years ago

I'm using latest framework7-vue-webpack template. When I'm trying to build the app with cordova build browser --release, I'm getting an error message:

Error happened when webpack build: Error: Command failed: "/Users/ino/Work/HTML5/image-upload-app/node_modules/.bin/webpack" --env.release /Users/ino/Work/HTML5/image-upload-app/node_modules/webpack-cli/bin/cli.js:93 throw err; ^

ReferenceError: path is not defined at module.exports (/Users/ino/Work/HTML5/image-upload-app/config/webpack.release.js:24:15)

I think the problem is related with update of clean-webpack-plugin to the 3.0.0 version. They changed options and parameters list for this plugin.

I fixed this problem by changing config/webpack.release.js file:

...
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
...
module.exports = function() {
  return webpackMerge(commonConfig({ mode: 'production' }), {
    ...
    plugins: [
      ...
      new CleanWebpackPlugin({
        dry: false,
        verbose: false
      })
    ]
  });
};

But I'm not sure if that's a correct solution. At least after this changes I can get release build for browser.

caiobiodere commented 4 years ago

thank you mate, I just fixed it on the new 2.4.4 version