Skip to content

Commit afe4481

Browse files
committed
test: add test svg
1 parent e360adc commit afe4481

File tree

8 files changed

+147
-0
lines changed

8 files changed

+147
-0
lines changed

test/build-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,7 @@ describe('lib/build', function () {
103103
it('should support common', () => {
104104
return testBuild({}, 'build-common');
105105
});
106+
it('should support svg', () => {
107+
return testBuild({}, 'build-svg');
108+
});
106109
});

test/expect/build-svg/common.js

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/******/ (function(modules) { // webpackBootstrap
2+
/******/ // install a JSONP callback for chunk loading
3+
/******/ var parentJsonpFunction = window["webpackJsonp"];
4+
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
5+
/******/ // add "moreModules" to the modules object,
6+
/******/ // then flag all "chunkIds" as loaded and fire callback
7+
/******/ var moduleId, chunkId, i = 0, callbacks = [];
8+
/******/ for(;i < chunkIds.length; i++) {
9+
/******/ chunkId = chunkIds[i];
10+
/******/ if(installedChunks[chunkId])
11+
/******/ callbacks.push.apply(callbacks, installedChunks[chunkId]);
12+
/******/ installedChunks[chunkId] = 0;
13+
/******/ }
14+
/******/ for(moduleId in moreModules) {
15+
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
16+
/******/ modules[moduleId] = moreModules[moduleId];
17+
/******/ }
18+
/******/ }
19+
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);
20+
/******/ while(callbacks.length)
21+
/******/ callbacks.shift().call(null, __webpack_require__);
22+
/******/ if(moreModules[0]) {
23+
/******/ installedModules[0] = 0;
24+
/******/ return __webpack_require__(0);
25+
/******/ }
26+
/******/ };
27+
28+
/******/ // The module cache
29+
/******/ var installedModules = {};
30+
31+
/******/ // object to store loaded and loading chunks
32+
/******/ // "0" means "already loaded"
33+
/******/ // Array means "loading", array contains callbacks
34+
/******/ var installedChunks = {
35+
/******/ 0:0
36+
/******/ };
37+
38+
/******/ // The require function
39+
/******/ function __webpack_require__(moduleId) {
40+
41+
/******/ // Check if module is in cache
42+
/******/ if(installedModules[moduleId])
43+
/******/ return installedModules[moduleId].exports;
44+
45+
/******/ // Create a new module (and put it into the cache)
46+
/******/ var module = installedModules[moduleId] = {
47+
/******/ exports: {},
48+
/******/ id: moduleId,
49+
/******/ loaded: false
50+
/******/ };
51+
52+
/******/ // Execute the module function
53+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
54+
55+
/******/ // Flag the module as loaded
56+
/******/ module.loaded = true;
57+
58+
/******/ // Return the exports of the module
59+
/******/ return module.exports;
60+
/******/ }
61+
62+
/******/ // This file contains only the entry chunk.
63+
/******/ // The chunk loading function for additional chunks
64+
/******/ __webpack_require__.e = function requireEnsure(chunkId, callback) {
65+
/******/ // "0" is the signal for "already loaded"
66+
/******/ if(installedChunks[chunkId] === 0)
67+
/******/ return callback.call(null, __webpack_require__);
68+
69+
/******/ // an array means "currently loading".
70+
/******/ if(installedChunks[chunkId] !== undefined) {
71+
/******/ installedChunks[chunkId].push(callback);
72+
/******/ } else {
73+
/******/ // start chunk loading
74+
/******/ installedChunks[chunkId] = [callback];
75+
/******/ var head = document.getElementsByTagName('head')[0];
76+
/******/ var script = document.createElement('script');
77+
/******/ script.type = 'text/javascript';
78+
/******/ script.charset = 'utf-8';
79+
/******/ script.async = true;
80+
81+
/******/ script.src = __webpack_require__.p + "" + ({"1":"index"}[chunkId]||chunkId) + ".js";
82+
/******/ head.appendChild(script);
83+
/******/ }
84+
/******/ };
85+
86+
/******/ // expose the modules object (__webpack_modules__)
87+
/******/ __webpack_require__.m = modules;
88+
89+
/******/ // expose the module cache
90+
/******/ __webpack_require__.c = installedModules;
91+
92+
/******/ // __webpack_public_path__
93+
/******/ __webpack_require__.p = "";
94+
/******/ })
95+
/************************************************************************/
96+
/******/ ([]);

test/expect/build-svg/index.css

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/expect/build-svg/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
webpackJsonp([1,0],[
2+
/* 0 */
3+
/***/ (function(module, exports, __webpack_require__) {
4+
5+
'use strict';
6+
7+
__webpack_require__(1);
8+
9+
console.log(1);
10+
11+
/***/ }),
12+
/* 1 */
13+
/***/ (function(module, exports) {
14+
15+
// removed by extract-text-webpack-plugin
16+
17+
/***/ })
18+
]);

test/fixtures/build-svg/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import './index.less';
2+
console.log(1);

test/fixtures/build-svg/index.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.info{
2+
background: url(./info.svg) no-repeat;
3+
}

test/fixtures/build-svg/info.svg

Lines changed: 17 additions & 0 deletions
Loading

test/fixtures/build-svg/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"entry": {
3+
"index": "./index.js"
4+
}
5+
}

0 commit comments

Comments
 (0)