Giter Site home page Giter Site logo

easy-team / easywebpack-vue Goto Github PK

View Code? Open in Web Editor NEW
29.0 5.0 9.0 368 KB

Vue Webpack Building Solution, Support Vue Server Side Render (SSR), Client Side Render (CSR) Building

Home Page: https://easyjs.cn

License: MIT License

JavaScript 100.00%
webpack vue server-side-rendering hot-reload webpack-vue vue-loader vue-node

easywebpack-vue's Introduction

easywebpack-vue

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Webpack client render and server side render build solution for Vue

Webapck 5

https://github.com/easy-team/easywebpack/tree/master/packages/framework/easywebpack-vue

Featues

easywebpack

see easywebpack

Documents

Version

  • @easy-team/easywebpack-vue ^4.x.x > Webpack 4.x.x + Babel 7
  • easywebpack-vue ^4.x.x > Webpack 4.x.x + Babel 6
  • easywebpack-vue ^3.x.x > Webpack 3.x.x + Babel 6

Install

$ npm i @easy-team/easywebpack-vue --save-dev

Usage

webpack.config.js

const easywebpack = require('@easy-team/easywebpack-vue');
const webpack = easywebpack.webpack;
const merge = easywebpack.merge;
const baseWebpackConfig = easywebpack.getWebpackConfig({
    env, // support dev, test, prod 
    target : 'web', // browser mode build
    entry:{
        app: 'src/index.js'
    }
});
module.exports = merge(baseWebpackConfig, {
   
})

use webpack command build

webpack --config webpack.config.js

base easywebpacack-cli build mode

const webpackConfig = require('./webpack.config.js');

if (process.env.NODE_SERVER) {
  // development mode: webpack building and start webpack hot server
  easywebpack.server(config);
} else {
  // build file to disk
  easywebpack.build(config);
}

Example

Questions & Suggestions

Please open an issue here.

License

MIT

easywebpack-vue's People

Contributors

beliefgp avatar hubcarl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

easywebpack-vue's Issues

是否已经适合在生产环境中使用?

  • 看到 egg + webpack + vue 的方式很适合我接下来的一个系统的开发,想直接用easywebpack-vue 作为前端基础方案进行使用,主要是做三套管理平台整合成一套后台管理系统,目前是否已经适合在生产环境中使用?
  • 作者是否已经有成功的实践案例?
  • 谢谢。

ERROR in js/vendor.cebaf7ea.js from Terser SyntaxError: Unexpected token .

webpack.config
`'use strict';
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
egg: true,
framework: 'vue',
entry: {
include: ['app/web/page'],
exclude: ['app/web/page/[a-z]+/component', 'app/web/page/elementjs'],
loader: {
client: 'app/web/framework/vue/entry/client-loader.js',
server: 'app/web/framework/vue/entry/server-loader.js',
}
},
compile: {
thread: true,
cache: true
},
alias: {
server: 'app/web/framework/vue/entry/server.js',
client: 'app/web/framework/vue/entry/client.js',
app: 'app/web/framework/vue/app.js',
asset: 'app/web/asset',
component: 'app/web/component',
framework: 'app/web/framework',
store: 'app/web/store',
vue: 'vue/dist/vue.js'
},
dll: ['vue', 'axios', 'vue-router', 'vuex', 'vuex-router-sync'],
loaders: {},
plugins: {
serviceworker: true
},
optimization: {
splitChunks: {
chunks: 'all'
},
// We no not want to minimize our code.
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
exclude: //videojs/,
chunkFilter: chunk => {
if (chunk.name || chunk.name !== 'mini-css-extract-plugin') {
return true;
}
return false;
},
terserOptions: {
compress: {
warnings: false,
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
}
}
})
]
},
done() {}
};`

ERROR in js/vendor.cebaf7ea.js from Terser
SyntaxError: Unexpected token .
at new Function ()
at module.exports (F:\egg-vue-webpack-boilerplate-webpack4\node_modules\terser-webpack-plugin\dist\worker.js:12:15)
at handle (F:\egg-vue-webpack-boilerplate-webpack4\node_modules\worker-farm\lib\child\index.js:44:8)
at process. (F:\egg-vue-webpack-boilerplate-webpack4\node_modules\worker-farm\lib\child\index.js:51:3)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emit (internal/child_process.js:772:12)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.