GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wangyingjun/webpack-guardian

BranchesTags
Open more actions menu

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
lib
lib
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

WEBPACK-GUARDIAN

webpack-guardian 是为了cli命令行工具,提供dev、build两个命令行

本项目采用 webpack 1.x 版本,作为IE8项目的配置工具命令行,为减小体积,请在 html模板 head标签中添加如下js,否则IE8下无法运行

<head>
    <!--[if lt IE 9]>
        <script src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-shim.min.js"></script>
        <script src="https://cdn.bootcss.com/es5-shim/4.5.10/es5-sham.min.js"></script>
    <![endif]-->
</head>

开始

# install
$ npm install webpack-guardian -D

# run dev
$ webpack-guardian dev

# run build
$ webpack-guardian build

配置文件

项目中创建 .webpackrc.js 文件,配置与webpack配置基本相同

#configuration
module.exports = {
    devtool: 'cheap-module-eval-source-map',
    entry: './src/index.js',
    output: {
        publicPath: '/register/',
    },
    dev: {
        output: {
            publicPath: '/',
        },
    },
    html: {
        template: './src/index.html'
    },
    babel: {
        plugins: [
			["import",
			{
				"libraryName": "antd",
				"style": "css"
			}]
		]
    },
    externals: {
        react: 'React',
        'react-dom': 'ReactDOM',
    },
    resolve: {
        alias: {
            'components': './src/components',
            'common': './src/common',
            'img': './src/img'
        }
    },
    proxy: {
    },
    port: 3001,
    open: true,
    inline: true
}

约定

默认值
入口 ./src/index.js
出口 ./dist  #不可修改
dev环境配置 dev: {} #当前只增加 output.publicPath

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

6 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.