Using webpack with an existing PHP and JS project

前端 未结 2 2008
孤独总比滥情好
孤独总比滥情好 2020-12-12 10:27

I have an existing PHP project with jquery and bootstrap, not using any front-end framework.

I am trying to use webpack module bundler in order to create a single en

2条回答
  •  囚心锁ツ
    2020-12-12 11:17

    Based on the existing vue-templates and and the answer from @Loilo I made a vue template you can install with vue-cli. This template jumpstarts you for a vue application you can extend with or integrate in you existing environment.

    npm install -g vue-cli
    vue init delcon/webpack-simple my-project
    cd my-project
    npm install
    

    devwatch:

    This template has an additional run devwatch option that watches for filechanges instead of using the webpack-dev-server. This makes it usable for any existing webserver enviroment.

    npm run devwatch
    

    dev:

    to run it with the default webpack-dev-server, remove in index.html:

    npm run dev
    

    build:

    to build your project for production:

    npm run build
    

提交回复
热议问题