Giter VIP home page Giter VIP logo

vue-share's Introduction

Vue通用后台模板

Isomorphic Web is an opinionated boilerplate for web development built on top of Node.js, Express and Vue, containing modern web development tools such as Webpack 3, Babel 6 and Browsersync. Helping you to stay productive following the best practices. A solid starting point for both professionals and newcomers to the industry.

Build Status

Features

How to Run and Build

Run

$ npm start

Build

$ npm run build

Run in dist

$ npm run start:dist

About CDN

Sometimes, we should host our static files(js,css,image and etc) in CDN, for this case you should change seetings in /cdn_config.js, for example: if our CDN root is http://cache.mycdn.com/, change //cache.YourCDN.com to //cache.mycdn.com

/cdn_settings.js

export default {
  dev: {
    publicPath: '/'
  },

  sit: {
    publicPath: '//sitcache.mycdn.com/'
  },

  uat: {
    publicPath: '//uatcache.mycdn.com/'
  },

  prod: {
    publicPath: '//cache.mycdn.com/'
  }
}

then use the following command for building, after built, upload the /build/public folder to CDN, thats all.

$ npm run build -- prod

NOTE: double dashes are required and there is a blank between -- and prod

About complie enviroment

We defined 2 parameters for identity complie enviroment

/tools/webpack/client.build.js

...
plugins: [
  new webpack.DefinePlugin({
    '__BROWSER__': true,
    '__DEV__': false
  }),
  ...
]  
...

You can use this 2 options in your code for condition compiling,

For example: In /src/routes/test/app-main/component.js, we use __BROWSER__ to tell compiler jquery.easypiechart and toastr only built for BROWSER, actually it is useless and cannot be used in node enviroment.

if (__BROWSER__) {
  require('easy-pie-chart/dist/jquery.easypiechart')
  require('toastr/toastr.scss')
  var toastr = require('toastr')
}

export default class Test {
  onMount() {
    $('.chart').easyPieChart({
      easing: 'easeOutBounce',
      onStep: function(from, to, percent) {
        $(this.el).find('.percent').text(Math.round(percent));
      }
    });

Analyse webpack stats

We have integrated tools for analysing bundled file, after run npm run build, try to type the following command in your terminal.

$ npm run analyse:client
$ npm run analyse:server
$ npm run analyse

About Browsersync

Navigate to http://localhost:3001 to open Browsersync control panel

Directory Layout

.
├── /public/                     # Static files which are copied into the /build/public folder
├── /src/                        # The source code of the application
│   ├── /components/             # Top level marko components
│   ├── /core/                   # Core module or utility library
│   ├── /layouts/                # Layout marko
│   ├── /routes/                 # Routes or pages
│   │   ├── /home/               # Example home page
│   │   │   ├── /components      # Page level compoment
│   │   │   ├── /images          # Page level images
│   │   │   ├── client.js        # Entry of client script
│   │   │   ├── index.js         # Router for server side
│   │   │   └── layout.marko     # Page template marko
│   │   └── /xxxx/               # xxxx page    
│   ├── /styles/                 # Global stylesheets
│   ├── /vendor/                 # Customised third-party library
│   ├── /assets-loader.js        # Loader for loading assets.json
│   └── /server.js               # Express server app
├── /tests/                      # Unit and end-to-end tests
├── /tools/                      # Build automation scripts and utilities
│   ├── /analyse/                # analyse tools for webpack stats
│   ├── /libs/                   # Library for build system
│   ├── /loaders/                # Custom webpack loader
│   ├── /plugins/                # Custom webpack plugin
│   ├── /webpack/                # Webpack config files
│   ├── /build-client.js         # Scripts for build client app
│   ├── /build-server.js         # Scripts for build server app
│   ├── /build.js                # Scripts for build client and server
│   ├── /clean.js                # Cleans up for the output (build) folder
│   ├── /config.js               # Build config file
│   ├── /copy.js                 # Copy package.json, public folder and assets.json
│   ├── /post.config.js          # Configuration for transforming styles with PostCSS
│   ├── /run.js                  # Helper function for running build automation tasks
│   ├── /start.js                # Launches the development web server with "live reload"
│   └── /watch.js                # watch public folder, if changed copy files to dist/public folder
└── package.json                 # The list of 3rd party libraries and utilities
└── entry-settings.js            # Configure client entry for built

How to Update

$ git checkout master
$ git pull origin master
$ npm install

Made with ♥ by Wu Jian Ping

vue-share's People

Contributors

zhihaosu avatar

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.