GithubHelp home page GithubHelp logo

h246802 / script-timestamp-webpack-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pingan8787/script-timestamp-webpack-plugin

0.0 1.0 0.0 13 KB

script-timestamp-webpack-plugin 是 Webpack 一款插件,用来在 Webpack 打包项目后生成的 index.html 文件中,为生成 js 文件的添加时间戳。🔥

Home Page: https://www.npmjs.com/package/script-timestamp-webpack-plugin

HTML 10.07% JavaScript 89.93%

script-timestamp-webpack-plugin's Introduction

一、插件介绍

script-timestamp-webpack-plugin 是 Webpack 一款插件,用来在 Webpack 打包项目后生成的 index.html 文件中,为生成 js 文件的添加时间戳。

实现效果:

script-timestamp-webpack-plugin

二、运行机制

script-timestamp-webpack-plugin运行机制

三、插件使用

1. 安装

npm install script-timestamp-webpack-plugin --save-dev

2. 使用

在模版文件中,添加脚本插入入口:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hello script-timestamp-webpack-plugin!</title>
</head>
<body>
    <!--script-timestamp-webpack-plugin inset script-->
</body>
</html>

script-timestamp-webpack-plugin

引入插件,并实例化:

// webpack.config.js

const ScriptTimestampWebpackPlugin = require("script-timestamp-webpack-plugin");
module.exports = {
  // ... 省略其他配置
  plugins: [
    // ... 省略其他插件
    new ScriptTimestampWebpackPlugin()  
  ]
}

三、Vuejs 使用

// vue.config.js

const ScriptTimestampWebpackPlugin = require("script-timestamp-webpack-plugin");
module.exports = {
  // ... 省略其他配置
  configureWebpack: {
    plugins: [
      // ... 省略其他插件
      new ScriptTimestampWebpackPlugin()  
    ]
  }
}

四、其他

React Angular 等,使用方法类似~~

script-timestamp-webpack-plugin's People

Contributors

pingan8787 avatar

Watchers

James Cloos 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.