G
G
gpyshenko2017-06-01 22:23:40
npm
gpyshenko, 2017-06-01 22:23:40

Can you share vuejs 2 config with webpack 2?

Here is my config:

"scripts": {
    "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
  },
  "dependencies": {
    "uglifyjs-webpack-plugin": "^0.4.3",
    "vue": "^2.3.3",
    "vue-router": "^2.5.3"
  },
  "devDependencies": {
    "babel-core": "^6.0.0",
    "babel-loader": "^6.0.0",
    "babel-preset-env": "^1.5.1",
    "cross-env": "^3.0.0",
    "css-loader": "^0.25.0",
    "file-loader": "^0.9.0",
    "node-sass": "^4.5.0",
    "sass-loader": "^5.0.1",
    "vue-loader": "^12.1.0",
    "vue-template-compiler": "^2.3.3",
    "webpack": "^2.6.1",
    "webpack-dev-server": "^2.4.5"
  }

You can tweak it so I have a Pug(Jade) templating engine, have an Autoprefixer and have the css compress. And then I switched from Gulp and so far I don’t understand how to set it up)) If you need settings in webpack.config.js for full performance, then discard it too))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2017-06-02
@gpyshenko

install vue-cli globally via npm, then run vue-init webpack-simple, add vue-router and what else you need manually via npm.
The "webpack" template works, but only to the extent that it exists. At least bootstrap-vue did not work (css was not included, unlike the webpack-simple template). Well, I don't know how to cook.
All the magic happens by itself, if everything is done in .vue files, vue-loader is responsible for this :
Read more here: vue-loader.vuejs.org/en/configurations/pre-process...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question