[Vuejs]-Uncaught ReferenceError: process is not defined vuejs, vuex , Webpack SSR

0👍

its worked for me when i add in Webpack.base.js — libraryTarget: ‘commonjs2’– like change from

(Webpack.js or Webpack.base.js or Webpack.config.js)

 output: {
   path: path.resolve(__dirname, "./dist"),
   publicPath: "/dist/",
   filename: "build.js"
  }

to

output: {
   path: path.resolve(__dirname, "./dist"),
   publicPath: "/dist/",
   filename: "build.js",
   libraryTarget: 'commonjs2'  
  },

libraryTarget: ‘commonjs2’
//this option allows users to insert comments within the export wrapper. To insert the same comment for each libraryTarget type, set auxiliaryComment to a string:
read more

Leave a comment