GithubHelp home page GithubHelp logo

webpack-multipage's Introduction

webpack multi-page

这是运用webpack5打包传统jQuery开发的多页面网站 的一个配置,有简单demo供参考

  • 项目运行
//clone the repository
git clone https://github.com/chaoyuwang/webpack-multipage.git

//install package
npm install

//development
npm run start

//production
npm run build

//view
http://127.0.0.1:8081
  • 目录
...
├── config                                   // webpack配置文件
├── ├── page.config.js                       // 静态页面配置
├── └── webpack.config.js                    // 基础配置文件
├── src                                      // 项目静态页
├── ├── style                                // 样式(css/scss)文件
├── ├── pages                                // html静态页面
├── ├── images                               // images文件
├── ├── js                                   // js脚本
├── ├── temp                                 // 本项目模拟数据文件
├── └── index.js                             // 项目入口文件
├── postcss.config.js                        // postcss配置文件
├── babel.config.js                          // babel配置文件
├── package.json                             // package
...

可根据个人开发习惯调整src内结构,修改相应配置文件即可

pages目录内根据页面命名,将html,css和js文件都放进当前页面文件夹,统一管理

项目较小,可以将多入口修改为单入口,即可打包成一个js和css引入网页

ToDo

  • devServer优化
  • 压缩图片
  • css压缩
  • ESLint等代码规范添加
  • 开发环境和生产环境文件分离
  • 开发文档编写

webpack-multipage's People

Contributors

ichaoyu avatar

Watchers

chaoyu 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.