-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add doc and test for resource attribute
- Loading branch information
Showing
15 changed files
with
222 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="zh"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Tencent QQ</title> | ||
<link async defer rel="stylesheet" href="//localhost:9000/./css/index-332d70.css"> | ||
</head> | ||
<body> | ||
<div id="pages" class="qq-ui"></div> | ||
|
||
|
||
<script async defer src=//localhost:9000/js/index-332d70.js></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
|
||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
|
||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
|
||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
|
||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
|
||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
|
||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
|
||
|
||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
|
||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
|
||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = "//localhost:9000/"; | ||
|
||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
module.exports = __webpack_require__(1); | ||
|
||
|
||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
|
||
"use strict"; | ||
|
||
__webpack_require__(2); | ||
|
||
var a = "hello world!"; | ||
|
||
/***/ }, | ||
/* 2 */ | ||
/***/ function(module, exports) { | ||
|
||
// removed by extract-text-webpack-plugin | ||
|
||
/***/ } | ||
/******/ ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="zh"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Tencent QQ</title> | ||
<link async defer rel="stylesheet" href="//localhost:9000/./css/index-332d70.css"> | ||
</head> | ||
<body> | ||
<div id="pages" class="qq-ui"></div> | ||
|
||
|
||
<script async defer src=//localhost:9000/js/index-332d70.js></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="zh"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Tencent QQ</title> | ||
<link async defer rel="stylesheet" href="index"> | ||
</head> | ||
<body> | ||
<div id="pages" class="qq-ui"></div> | ||
|
||
|
||
<script async defer src=index></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
require('./index.less'); | ||
|
||
var a = "hello world!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const path = require('path'); | ||
|
||
var webpack = require('webpack'), | ||
config = require('../../config/config'), | ||
nodeModulesPath = path.resolve('../node_modules'); | ||
|
||
var HtmlResWebpackPlugin = require('../../../index'), | ||
ExtractTextPlugin = require("extract-text-webpack-plugin-steamer"); | ||
|
||
module.exports = { | ||
entry: { | ||
index: [path.join(config.path.src, "/resource-attr-1/index")] | ||
}, | ||
output: { | ||
publicPath: config.defaultPath, | ||
path: path.join(config.path.dist + '/resource-attr-1/'), | ||
filename: "js/[name]" + config.chunkhash + ".js", | ||
chunkFilename: "js/chunk/[name]" + config.chunkhash + ".js", | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js?$/, | ||
loader: 'babel', | ||
query: { | ||
cacheDirectory: false, | ||
presets: [ | ||
'es2015', | ||
] | ||
}, | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loader: ExtractTextPlugin.extract("style-loader", "css-loader"), | ||
include: path.resolve(config.path.src) | ||
}, | ||
{ | ||
test: /\.less$/, | ||
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader"), | ||
include: [nodeModulesPath, path.resolve(config.path.src)] | ||
}, | ||
{ | ||
test: /\.html$/, | ||
loader: 'html-loader' | ||
}, | ||
{ | ||
test: /\.(jpe?g|png|gif|svg)$/i, | ||
loaders: [ | ||
"url-loader?limit=1000&name=img/[name]" + config.hash + ".[ext]", | ||
], | ||
include: path.resolve(config.path.src) | ||
}, | ||
], | ||
noParse: [ | ||
|
||
] | ||
}, | ||
plugins: [ | ||
new webpack.optimize.OccurrenceOrderPlugin(), | ||
new webpack.NoErrorsPlugin(), | ||
new ExtractTextPlugin("./css/[name]" + config.chunkhash + ".css"), | ||
new HtmlResWebpackPlugin({ | ||
mode: "html", | ||
filename: "index.html", | ||
template: config.path.src + "/resource-attr-1/index.html", | ||
htmlMinify: null | ||
}) | ||
], | ||
}; |