项目作者: Edurtu

项目描述 :
Webpack development server with multipage website in Html5, JS and CSS.
高级语言: JavaScript
项目地址: git://github.com/Edurtu/webpack-server.git
创建时间: 2019-04-19T11:39:12Z
项目社区:https://github.com/Edurtu/webpack-server

开源协议:Other

下载


Webpack-Server

Español | License


Development server (with webpack)

A simple development server for multi-page site in Html5, JS y CSS. Features:

  • A separete folder configuration for webpack (production and development)

  • It use HtmlWebpackPlugin plugin to define each page, title and activate class for the active item menu.

  • Bootstrap source files. For an easy implementation, the compiled and minified files are used, called in index.js and you can change it.

  • Some declarete rules (into config webpack):

    • Split code js
    • Separate CSS files
    • Sass y Postcss: autoprefixer y cssnano (minify)
    • Loader and optimize files images
    • Loader fonts files
    • Handlebars template

Install

1) Install Node.js

2) Clone the webpack-server repository:

  1. ```sh
  2. git clone https://github.com/Edurtu/webpack-server.git
  3. ```

3) Navigate to the webpack-server folder

  1. ```sh
  2. cd webpack-server
  3. ```

4) Install dependencies:

  1. ```sh
  2. npm install
  3. ```

Considerations

  • The entry files of our project, is inside src folder
  • The production folder is dist, you can change it in webpack.prod.js. Erase and recreate the production folder, type:

    1. npm run build
  • It integrate a simple web server and ability to use live reloading with webpack-dev-server module, in webpack.dev.js you can change the configurable options. Run the development server typing:

    1. npm start

Spanish

Servidor para desarrollo (con Webpack)

Servidor de desarrollo para sitio web multi-página en Html5, JS y CSS. Características:

  • Carpeta de configuración separada en webpack (producción y desarrollo).

  • Uso del plugin HtmlWebpackPlugin para definir cada página, su título y activación de la opción del menú en la navegación

  • Archivos fuente de Bootstrap. Para una implementación fácil se usan los ficheros complilados y minificados, estos son llamados en index.js donde puedes cambiarlo.

  • Algunas reglas declaradas (config webpack):

    • División de módulos js
    • Extracción de css
    • Sass y Postcss: autoprefixer y cssnano (minificación)
    • Lector y optimización de imágenes
    • Lector de fuentes locales
    • Uso del sistema de plantillas Handlebars

Instalación

1) Instala Node.js
2) Clona el repositorio webpack-server:

  1. ```sh
  2. git clone https://github.com/Edurtu/webpack-server.git
  3. ```

3) Entra en la carpeta webpack-server

  1. ```sh
  2. cd webpack-server
  3. ```

4) Instala las dependencias:

  1. ```sh
  2. npm install
  3. ```

Consideraciones

  • Estructura del proyecto en la carpeta src
  • Carpeta de producción ‘generada’ dist, configuración en webpack.prod.js

    1. npm run build
  • Servidor de desarrollo webpack-dev-server, configuración en webpack.dev.js

    1. npm start

License

License MIT https://opensource.org/licenses/mit-license.php