├── dist
├── 1-aaa.jpg
├── index.html
├── styles.4389b935.css
├── runtime.bcdaec9b.js
└── app.86e10d14.js
├── .babelrc
├── src
├── assets
│ ├── images
│ │ ├── 1.jpg
│ │ ├── check-circle.svg
│ │ └── close-circle.svg
│ └── styles
│ │ ├── footer.styl
│ │ └── global.styl
├── index.js
├── todo
│ ├── footer.jsx
│ ├── header.vue
│ ├── todo.vue
│ ├── tabs.vue
│ └── item.vue
└── app.vue
├── postcss.config.js
├── LICENSE
├── package.json
├── README.md
└── webpack.config.js
/dist/1-aaa.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maitel2020/Vue-Webpack-Todo/HEAD/dist/1-aaa.jpg
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets":[
3 | "env"
4 | ],
5 | "plugins":[
6 | "transform-vue-jsx"
7 | ]
8 | }
--------------------------------------------------------------------------------
/src/assets/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maitel2020/Vue-Webpack-Todo/HEAD/src/assets/images/1.jpg
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | const autoprefixer = require('autoprefixer')
2 |
3 | module.exports ={
4 | plugins:[
5 | autoprefixer() //作用是用于自动加前缀的css
6 | ]
7 | }
--------------------------------------------------------------------------------
/src/assets/styles/footer.styl:
--------------------------------------------------------------------------------
1 | #footer
2 | margin-top 40px
3 | text-align center
4 | color #bfbfbf
5 | font-size 30px
6 | text-shadow 0px 1px 0px 1px
7 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './app.vue'
3 | import './assets/styles/global.styl'
4 |
5 |
6 | const root = document.createElement('div')
7 | document.body.appendChild(root)
8 |
9 |
10 | new Vue({
11 | render: (h) => h(App)
12 | }).$mount(root)
--------------------------------------------------------------------------------
/src/todo/footer.jsx:
--------------------------------------------------------------------------------
1 | import '../assets/styles/footer.styl'
2 | export default{
3 | data() {
4 | return{
5 | author: 'zsp'
6 | }
7 | },
8 | render(){
9 | return (
10 |
13 | )
14 | }
15 | }
--------------------------------------------------------------------------------
/src/todo/header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/assets/styles/global.styl:
--------------------------------------------------------------------------------
1 | html,body{
2 | margin:0px
3 | padding:0px
4 | width:100%
5 | height:100%
6 | }
7 | body{
8 | background-image:url('../images/1.jpg');
9 | background-size:cover;
10 | background-position:center;
11 | font:14px 'microsoft yahei';
12 | color:#4d4d4d;
13 | font-weight:300;
14 | }
--------------------------------------------------------------------------------
/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Webpack App
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/dist/styles.4389b935.css:
--------------------------------------------------------------------------------
1 | #footer {
2 | margin-top: 40px;
3 | text-align: center;
4 | color: #bfbfbf;
5 | font-size: 30px;
6 | text-shadow: 0px 1px 0px 1px;
7 | }
8 | html,
9 | body {
10 | margin: 0px;
11 | padding: 0px;
12 | width: 100%;
13 | height: 100%;
14 | }
15 | body {
16 | background-image: url(1-aaa.jpg);
17 | background-size: cover;
18 | background-position: center;
19 | font: 14px 'microsoft yahei';
20 | color: #4d4d4d;
21 | font-weight: 300;
22 | }
23 |
--------------------------------------------------------------------------------
/src/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
23 |
24 |
--------------------------------------------------------------------------------
/src/assets/images/check-circle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/assets/images/close-circle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 maitel2020
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-webpack",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.js",
9 | "dev": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js"
10 | },
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "autoprefixer": "^7.2.3",
15 | "babel-core": "^6.26.0",
16 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
17 | "babel-loader": "^7.1.2",
18 | "babel-plugin-syntax-jsx": "^6.18.0",
19 | "babel-plugin-transform-vue-jsx": "^3.5.0",
20 | "babel-preset-env": "^1.6.1",
21 | "cross-env": "^5.1.6",
22 | "css-loader": "^0.28.11",
23 | "extract-text-webpack-plugin": "^3.0.2",
24 | "file-loader": "^1.1.11",
25 | "html-webpack-plugin": "^3.2.0",
26 | "postcss-loader": "^2.0.9",
27 | "style-loader": "^0.21.0",
28 | "stylus": "^0.54.5",
29 | "stylus-loader": "^3.0.2",
30 | "url-loader": "^1.0.1",
31 | "vue": "^2.5.13",
32 | "vue-loader": "^13.6.0",
33 | "vue-template-compiler": "^2.5.13",
34 | "webpack": "^3.10.0",
35 | "webpack-dev-server": "^2.9.7"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vue+Webpack打造todo应用
2 |
3 | 原视频:https://www.imooc.com/video/16404
4 | 刚开始也走了很多弯路,主要是模块版本导致的,最后采取只要老师的模块安装完成后,我就暂停记版本号,这样下来,才一路顺通。
5 | 既然是入门,很多模块我也顺便记了下作用。刚开始我是记在json文件里的,npm run时一直报错,便百度了一下下,原来json里不能用//、/**/等这些注释符号...
6 |
7 | 热更新不起作用时,就把node_modules这个文件夹删了,然后npm i重新下载,而我先把node_modules这个文件夹改个名,接着npm i重新下载,因为删node_modules也要一些时间,不想等。。
8 |
9 | https://www.jianshu.com/p/42e11515c10f 《入门Webpack,看这篇就够了》顺便也看看
10 |
11 |
12 | 视频里所有提到的插件,描述可能不是很准确,毕竟也是从网上拼凑出来的
13 | webpack
14 | Vue
15 | vue-loader
16 | css-loader-------处理css文件中的url()等 http://www.css88.com/doc/webpack/loaders/css-loader/
17 | style-loader-------自动将css代码放到生成的style标签中插入到head标签里 http://www.css88.com/doc/webpack/loaders/style-loader/
18 | url-loader-------解决图片较多,会发很多http请求,会降低页面性能等问题 http://www.css88.com/doc/webpack/loaders/url-loader/
19 | file-loader-------解决图片引入问题 http://www.css88.com/doc/webpack/loaders/file-loader/
20 | stylus
21 | stylus-loader-------将stylus语言转化为原生css
22 | cross-env-------运行跨平台设置和使用环境变量的脚本
23 | html-webpack-plugin-------生成一个自动引用你打包后的JS文件的新index.html。这在每次生成的js文件名称不同时非常有用(比如添加了hash值)
24 | webpack-dev-server-------提供了开发环境调试工具 https://blog.csdn.net/qq_38652603/article/details/73865017
25 | postcss-loader-------补全css代码的兼容性前缀
26 | autoprefixer-------自动添加css前缀的功能
27 | babel-plugin-syntax-jsx
28 | babel-helper-vue-jsx-merge-props
29 | extract-text-webpack-plugin-------将样式文件单独打包 http://www.css88.com/doc/webpack/plugins/extract-text-webpack-plugin/
30 | babel-preset-env-------根据当前的运行环境来自动配置源码到当前环境可正常运行的代码的编译转换 https://coding.imooc.com/learn/questiondetail/8901.html
31 | babel-plugin-transform-vue-jsx-------Vue官方提供了一个叫做babel-plugin-transform-vue-jsx的插件来编译JSX
32 | babel-core-------babel-core是作为babel的核心存在,babel的核心api都在这个模块里面
33 | babel-loader-------调用babel-core的API来完成转译过程 http://www.css88.com/doc/webpack/loaders/babel-loader/
--------------------------------------------------------------------------------
/src/todo/todo.vue:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
68 |
69 |
--------------------------------------------------------------------------------
/src/todo/tabs.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{unFinishedTodoLength}} items left
4 |
5 |
11 | {{state}}
12 |
13 |
14 | Clear Completed
15 |
16 |
17 |
18 |
50 |
51 |
--------------------------------------------------------------------------------
/src/todo/item.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
28 |
29 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 | const HTMLPlugin = require('html-webpack-plugin')
3 | const webpack = require('webpack')
4 | const ExtractPlugin = require('extract-text-webpack-plugin')
5 |
6 | const isDev = process.env.NODE_ENV === 'development'
7 | const config = {
8 | target: 'web', //跑在浏览器上,所以编译目标是web
9 | entry: path.join(__dirname, 'src/index.js'),
10 | output: {
11 | filename: 'bundle.[hash:8].js',
12 | path: path.join(__dirname, 'dist')
13 | },
14 | module: {
15 | rules: [{
16 | test: /\.vue$/,
17 | loader: 'vue-loader'
18 | }, {
19 | test: /\.jsx$/,
20 | loader: 'babel-loader'
21 | },
22 | {
23 | test: /\.(gif|jpg|jpeg|png|svg)$/,
24 | use: [{
25 | loader: 'url-loader',
26 | options: {
27 | limit: 1024,
28 | name: '[name]-aaa.[ext]'
29 | }
30 | }]
31 | }
32 | ]
33 | },
34 | plugins: [
35 | //判断环境,vue框架一定要用
36 | new webpack.DefinePlugin({
37 | 'process.env': {
38 | NODE_ENV: isDev ? '"development"' : '"production"'
39 | }
40 | }),
41 | new HTMLPlugin()
42 | ]
43 | }
44 |
45 | if (isDev) {
46 | config.module.rules.push({
47 | test: /\.styl/,
48 | use: [
49 | 'style-loader',
50 | 'css-loader',
51 | {
52 | loader: 'postcss-loader',
53 | options: {
54 | sourceMap: true,
55 | }
56 | },
57 | 'stylus-loader'
58 | ]
59 | })
60 | config.devtool = '#cheap-module-eval-source-map' //帮助我们调试代码
61 | //dev配置
62 | config.devServer = {
63 | port: 8000,
64 | host: '0.0.0.0',
65 | overlay: { //错误显示在网页上
66 | errors: true
67 | },
68 | hot: true //热更新,只重新渲染该页面的组件
69 | }
70 | config.plugins.push(
71 | new webpack.HotModuleReplacementPlugin(), //配合hot使用
72 | new webpack.NoEmitOnErrorsPlugin() //减少不需要的信息展示
73 | )
74 |
75 | } else {
76 | config.entry = {
77 | app: path.join(__dirname, 'src/index.js'),
78 | vendor: ['vue']
79 | }
80 | config.output.filename = '[name].[chunkhash:8].js'
81 | config.module.rules.push({
82 | test: /\.styl/,
83 | use: ExtractPlugin.extract({
84 | fallback: 'style-loader',
85 | use: [
86 | 'css-loader',
87 | {
88 | loader: 'postcss-loader',
89 | options: {
90 | sourceMap: true,
91 | }
92 | },
93 | 'stylus-loader'
94 | ]
95 | })
96 | })
97 | config.plugins.push(
98 | new ExtractPlugin('styles.[contentHash:8].css'),
99 | //vendor一定要在runtime前面
100 | new webpack.optimize.CommonsChunkPlugin({
101 | name: 'vendor'
102 | }),
103 | new webpack.optimize.CommonsChunkPlugin({
104 | name: 'runtime'
105 | })
106 | )
107 | }
108 |
109 | module.exports = config
--------------------------------------------------------------------------------
/dist/runtime.bcdaec9b.js:
--------------------------------------------------------------------------------
1 | /******/ (function(modules) { // webpackBootstrap
2 | /******/ // install a JSONP callback for chunk loading
3 | /******/ var parentJsonpFunction = window["webpackJsonp"];
4 | /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
5 | /******/ // add "moreModules" to the modules object,
6 | /******/ // then flag all "chunkIds" as loaded and fire callback
7 | /******/ var moduleId, chunkId, i = 0, resolves = [], result;
8 | /******/ for(;i < chunkIds.length; i++) {
9 | /******/ chunkId = chunkIds[i];
10 | /******/ if(installedChunks[chunkId]) {
11 | /******/ resolves.push(installedChunks[chunkId][0]);
12 | /******/ }
13 | /******/ installedChunks[chunkId] = 0;
14 | /******/ }
15 | /******/ for(moduleId in moreModules) {
16 | /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
17 | /******/ modules[moduleId] = moreModules[moduleId];
18 | /******/ }
19 | /******/ }
20 | /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
21 | /******/ while(resolves.length) {
22 | /******/ resolves.shift()();
23 | /******/ }
24 | /******/ if(executeModules) {
25 | /******/ for(i=0; i < executeModules.length; i++) {
26 | /******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]);
27 | /******/ }
28 | /******/ }
29 | /******/ return result;
30 | /******/ };
31 | /******/
32 | /******/ // The module cache
33 | /******/ var installedModules = {};
34 | /******/
35 | /******/ // objects to store loaded and loading chunks
36 | /******/ var installedChunks = {
37 | /******/ 2: 0
38 | /******/ };
39 | /******/
40 | /******/ // The require function
41 | /******/ function __webpack_require__(moduleId) {
42 | /******/
43 | /******/ // Check if module is in cache
44 | /******/ if(installedModules[moduleId]) {
45 | /******/ return installedModules[moduleId].exports;
46 | /******/ }
47 | /******/ // Create a new module (and put it into the cache)
48 | /******/ var module = installedModules[moduleId] = {
49 | /******/ i: moduleId,
50 | /******/ l: false,
51 | /******/ exports: {}
52 | /******/ };
53 | /******/
54 | /******/ // Execute the module function
55 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
56 | /******/
57 | /******/ // Flag the module as loaded
58 | /******/ module.l = true;
59 | /******/
60 | /******/ // Return the exports of the module
61 | /******/ return module.exports;
62 | /******/ }
63 | /******/
64 | /******/ // This file contains only the entry chunk.
65 | /******/ // The chunk loading function for additional chunks
66 | /******/ __webpack_require__.e = function requireEnsure(chunkId) {
67 | /******/ var installedChunkData = installedChunks[chunkId];
68 | /******/ if(installedChunkData === 0) {
69 | /******/ return new Promise(function(resolve) { resolve(); });
70 | /******/ }
71 | /******/
72 | /******/ // a Promise means "currently loading".
73 | /******/ if(installedChunkData) {
74 | /******/ return installedChunkData[2];
75 | /******/ }
76 | /******/
77 | /******/ // setup Promise in chunk cache
78 | /******/ var promise = new Promise(function(resolve, reject) {
79 | /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
80 | /******/ });
81 | /******/ installedChunkData[2] = promise;
82 | /******/
83 | /******/ // start chunk loading
84 | /******/ var head = document.getElementsByTagName('head')[0];
85 | /******/ var script = document.createElement('script');
86 | /******/ script.type = 'text/javascript';
87 | /******/ script.charset = 'utf-8';
88 | /******/ script.async = true;
89 | /******/ script.timeout = 120000;
90 | /******/
91 | /******/ if (__webpack_require__.nc) {
92 | /******/ script.setAttribute("nonce", __webpack_require__.nc);
93 | /******/ }
94 | /******/ script.src = __webpack_require__.p + "" + chunkId + "." + {"0":"86e10d14","1":"d44c638b"}[chunkId] + ".js";
95 | /******/ var timeout = setTimeout(onScriptComplete, 120000);
96 | /******/ script.onerror = script.onload = onScriptComplete;
97 | /******/ function onScriptComplete() {
98 | /******/ // avoid mem leaks in IE.
99 | /******/ script.onerror = script.onload = null;
100 | /******/ clearTimeout(timeout);
101 | /******/ var chunk = installedChunks[chunkId];
102 | /******/ if(chunk !== 0) {
103 | /******/ if(chunk) {
104 | /******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
105 | /******/ }
106 | /******/ installedChunks[chunkId] = undefined;
107 | /******/ }
108 | /******/ };
109 | /******/ head.appendChild(script);
110 | /******/
111 | /******/ return promise;
112 | /******/ };
113 | /******/
114 | /******/ // expose the modules object (__webpack_modules__)
115 | /******/ __webpack_require__.m = modules;
116 | /******/
117 | /******/ // expose the module cache
118 | /******/ __webpack_require__.c = installedModules;
119 | /******/
120 | /******/ // define getter function for harmony exports
121 | /******/ __webpack_require__.d = function(exports, name, getter) {
122 | /******/ if(!__webpack_require__.o(exports, name)) {
123 | /******/ Object.defineProperty(exports, name, {
124 | /******/ configurable: false,
125 | /******/ enumerable: true,
126 | /******/ get: getter
127 | /******/ });
128 | /******/ }
129 | /******/ };
130 | /******/
131 | /******/ // getDefaultExport function for compatibility with non-harmony modules
132 | /******/ __webpack_require__.n = function(module) {
133 | /******/ var getter = module && module.__esModule ?
134 | /******/ function getDefault() { return module['default']; } :
135 | /******/ function getModuleExports() { return module; };
136 | /******/ __webpack_require__.d(getter, 'a', getter);
137 | /******/ return getter;
138 | /******/ };
139 | /******/
140 | /******/ // Object.prototype.hasOwnProperty.call
141 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
142 | /******/
143 | /******/ // __webpack_public_path__
144 | /******/ __webpack_require__.p = "";
145 | /******/
146 | /******/ // on error function for async loading
147 | /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
148 | /******/ })
149 | /************************************************************************/
150 | /******/ ([]);
--------------------------------------------------------------------------------
/dist/app.86e10d14.js:
--------------------------------------------------------------------------------
1 | webpackJsonp([0],[
2 | /* 0 */
3 | /***/ (function(module, exports) {
4 |
5 | /*
6 | MIT License http://www.opensource.org/licenses/mit-license.php
7 | Author Tobias Koppers @sokra
8 | */
9 | // css base code, injected by the css-loader
10 | module.exports = function(useSourceMap) {
11 | var list = [];
12 |
13 | // return the list of modules as css string
14 | list.toString = function toString() {
15 | return this.map(function (item) {
16 | var content = cssWithMappingToString(item, useSourceMap);
17 | if(item[2]) {
18 | return "@media " + item[2] + "{" + content + "}";
19 | } else {
20 | return content;
21 | }
22 | }).join("");
23 | };
24 |
25 | // import a list of modules into the list
26 | list.i = function(modules, mediaQuery) {
27 | if(typeof modules === "string")
28 | modules = [[null, modules, ""]];
29 | var alreadyImportedModules = {};
30 | for(var i = 0; i < this.length; i++) {
31 | var id = this[i][0];
32 | if(typeof id === "number")
33 | alreadyImportedModules[id] = true;
34 | }
35 | for(i = 0; i < modules.length; i++) {
36 | var item = modules[i];
37 | // skip already imported module
38 | // this implementation is not 100% perfect for weird media query combinations
39 | // when a module is imported multiple times with different media queries.
40 | // I hope this will never occur (Hey this way we have smaller bundles)
41 | if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
42 | if(mediaQuery && !item[2]) {
43 | item[2] = mediaQuery;
44 | } else if(mediaQuery) {
45 | item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
46 | }
47 | list.push(item);
48 | }
49 | }
50 | };
51 | return list;
52 | };
53 |
54 | function cssWithMappingToString(item, useSourceMap) {
55 | var content = item[1] || '';
56 | var cssMapping = item[3];
57 | if (!cssMapping) {
58 | return content;
59 | }
60 |
61 | if (useSourceMap && typeof btoa === 'function') {
62 | var sourceMapping = toComment(cssMapping);
63 | var sourceURLs = cssMapping.sources.map(function (source) {
64 | return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
65 | });
66 |
67 | return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
68 | }
69 |
70 | return [content].join('\n');
71 | }
72 |
73 | // Adapted from convert-source-map (MIT)
74 | function toComment(sourceMap) {
75 | // eslint-disable-next-line no-undef
76 | var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
77 | var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
78 |
79 | return '/*# ' + data + ' */';
80 | }
81 |
82 |
83 | /***/ }),
84 | /* 1 */
85 | /***/ (function(module, exports, __webpack_require__) {
86 |
87 | /*
88 | MIT License http://www.opensource.org/licenses/mit-license.php
89 | Author Tobias Koppers @sokra
90 | Modified by Evan You @yyx990803
91 | */
92 |
93 | var hasDocument = typeof document !== 'undefined'
94 |
95 | if (typeof DEBUG !== 'undefined' && DEBUG) {
96 | if (!hasDocument) {
97 | throw new Error(
98 | 'vue-style-loader cannot be used in a non-browser environment. ' +
99 | "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
100 | ) }
101 | }
102 |
103 | var listToStyles = __webpack_require__(16)
104 |
105 | /*
106 | type StyleObject = {
107 | id: number;
108 | parts: Array
109 | }
110 |
111 | type StyleObjectPart = {
112 | css: string;
113 | media: string;
114 | sourceMap: ?string
115 | }
116 | */
117 |
118 | var stylesInDom = {/*
119 | [id: number]: {
120 | id: number,
121 | refs: number,
122 | parts: Array<(obj?: StyleObjectPart) => void>
123 | }
124 | */}
125 |
126 | var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
127 | var singletonElement = null
128 | var singletonCounter = 0
129 | var isProduction = false
130 | var noop = function () {}
131 | var options = null
132 | var ssrIdKey = 'data-vue-ssr-id'
133 |
134 | // Force single-tag solution on IE6-9, which has a hard limit on the # of