-
Notifications
You must be signed in to change notification settings - Fork 12
/
crafty-preset-postcss-webpack.js.snap
199 lines (172 loc) · 16.2 KB
/
crafty-preset-postcss-webpack.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Compiles CSS within webpack 1`] = `
Object {
"status": 0,
"stdall": "
[__:__:__] Starting Crafty __version__...
[__:__:__] Files will be stored in:
css: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/compiles/dist/css
js: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/compiles/dist/js
[__:__:__] Starting 'default' ...
[__:__:__] Starting 'js' ...
[__:__:__] Starting 'js_myBundle' ...
asset myBundle.min.js ___ KiB [emitted] [minimized] (name: default)
sourceMap myBundle.min.js.map ___ KiB [emitted] [dev] (auxiliary name: default)
Entrypoint default ___ KiB (___ KiB) = myBundle.min.js 1 auxiliary asset
chunk (runtime: default) myBundle.min.js (default) ___ KiB (javascript) ___ bytes (runtime) [entry] [rendered]
dependent modules ___ KiB [dependent] 9 modules
runtime modules ___ bytes 4 modules
./js/app.js + 2 modules ___ KiB [built] [code generated]
Compiled successfully!
Δt ____ms
[__:__:__] Finished 'js_myBundle' after ____ ms
[__:__:__] Finished 'js' after ____ ms
[__:__:__] Finished 'default' after ____ ms
",
}
`;
exports[`Compiles CSS within webpack 2`] = `
"(function(e,n){if(\\"object\\"===typeof exports&&\\"object\\"===typeof module)module.exports=n();else if(\\"function\\"===typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)(\\"object\\"===typeof exports?exports:e)[r]=t[r]}})(self,(function(){return function(){\\"use strict\\";var e={176:function(e,n,t){var r=t(788);var o=/*#__PURE__*/t.n(r);var a=t(70);var i=/*#__PURE__*/t.n(a);var c=i()(o());c.push([e.id,\\"a{color:#00f}.Child{background:#000}.Parent{background:#fff}.Parent--before{color:#333}.Parent--after{color:#eee}.Button{color:orange}.Menu{width:800px}.MenuLink{color:red;background:#056ef0;width:200px}\\",\\"\\"]),n.Z=c},70:function(e){e.exports=function(e){var n=[];return n.toString=function(){return this.map((function(n){var t=\\"\\";var r=\\"undefined\\"!==typeof n[5];return n[4]&&(t+=\\"@supports (\\".concat(n[4],\\") {\\")),n[2]&&(t+=\\"@media \\".concat(n[2],\\" {\\")),r&&(t+=\\"@layer\\".concat(n[5].length>0?\\" \\".concat(n[5]):\\"\\",\\" {\\")),t+=e(n),r&&(t+=\\"}\\"),n[2]&&(t+=\\"}\\"),n[4]&&(t+=\\"}\\"),t})).join(\\"\\")},n.i=function(e,t,r,o,a){\\"string\\"===typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var c=0;c<this.length;c++){var u=this[c][0];null!=u&&(i[u]=!0)}for(var f=0;f<e.length;f++){var s=[].concat(e[f]);if(r&&i[s[0]])continue;\\"undefined\\"!==typeof a&&(\\"undefined\\"===typeof s[5]||(s[1]=\\"@layer\\".concat(s[5].length>0?\\" \\".concat(s[5]):\\"\\",\\" {\\").concat(s[1],\\"}\\")),s[5]=a),t&&(s[2]?(s[1]=\\"@media \\".concat(s[2],\\" {\\").concat(s[1],\\"}\\"),s[2]=t):s[2]=t),o&&(s[4]?(s[1]=\\"@supports (\\".concat(s[4],\\") {\\").concat(s[1],\\"}\\"),s[4]=o):s[4]=\\"\\".concat(o)),n.push(s)}},n}},788:function(e){e.exports=function(e){return e[1]}},191:function(e){var n=[];function t(e){var t=-1;for(var r=0;r<n.length;r++)if(n[r].identifier===e){t=r;break}return t}function r(e,r){var a={};var i=[];for(var c=0;c<e.length;c++){var u=e[c];var f=r.base?u[0]+r.base:u[0];var s=a[f]||0;var l=\\"\\".concat(f,\\" \\").concat(s);a[f]=s+1;var p=t(l);var d={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==p)n[p].references++,n[p].updater(d);else{var v=o(d,r);r.byIndex=c,n.splice(c,0,{identifier:l,updater:v,references:1})}i.push(l)}return i}function o(e,n){var t=n.domAPI(n);t.update(e);var r=function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap&&n.supports===e.supports&&n.layer===e.layer)return;t.update(e=n)}else t.remove()};return r}e.exports=function(e,o){o=o||{},e=e||[];var a=r(e,o);return function(e){e=e||[];for(var i=0;i<a.length;i++){var c=a[i];var u=t(c);n[u].references--}var f=r(e,o);for(var s=0;s<a.length;s++){var l=a[s];var p=t(l);0===n[p].references&&(n[p].updater(),n.splice(p,1))}a=f}}},532:function(e){var n={};function t(e){if(\\"undefined\\"===typeof n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}function r(e,n){var r=t(e);if(!r)throw new Error(\\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\\");r.appendChild(n)}e.exports=r},102:function(e){function n(e){var n=document.createElement(\\"style\\");return e.setAttributes(n,e.attributes),e.insert(n,e.options),n}e.exports=n},709:function(e,n,t){function r(e){var n=t.nc;n&&e.setAttribute(\\"nonce\\",n)}e.exports=r},520:function(e){function n(e,n,t){var r=\\"\\";t.supports&&(r+=\\"@supports (\\".concat(t.supports,\\") {\\")),t.media&&(r+=\\"@media \\".concat(t.media,\\" {\\"));var o=\\"undefined\\"!==typeof t.layer;o&&(r+=\\"@layer\\".concat(t.layer.length>0?\\" \\".concat(t.layer):\\"\\",\\" {\\")),r+=t.css,o&&(r+=\\"}\\"),t.media&&(r+=\\"}\\"),t.supports&&(r+=\\"}\\");var a=t.sourceMap;a&&\\"undefined\\"!==typeof btoa&&(r+=\\"\\\\n/*# sourceMappingURL=data:application/json;base64,\\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a)))),\\" */\\")),n.styleTagTransform(r,e,n.options)}function t(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}function r(e){var r=e.insertStyleElement(e);return{update:function(t){n(r,e,t)},remove:function(){t(r)}}}e.exports=r},912:function(e){function n(e,n){if(n.styleSheet)n.styleSheet.cssText=e;else{while(n.firstChild)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(e))}}e.exports=n}};var n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={id:r,exports:{}};return e[r](a,a.exports,t),a.exports}t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.r=function(e){\\"undefined\\"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})};var r={};return function(){function e(e,n){if(!(e instanceof n))throw new TypeError(\\"Cannot call a class as a function\\")}t.r(r),t.d(r,{default:function(){return h}});var n=t(191);var o=/*#__PURE__*/t.n(n);var a=t(520);var i=/*#__PURE__*/t.n(a);var c=t(532);var u=/*#__PURE__*/t.n(c);var f=t(709);var s=/*#__PURE__*/t.n(f);var l=t(102);var p=/*#__PURE__*/t.n(l);var d=t(912);var v=/*#__PURE__*/t.n(d);var y=t(176);var m={};m.styleTagTransform=v(),m.setAttributes=s(),m.insert=u().bind(null,\\"head\\"),m.domAPI=i(),m.insertStyleElement=p();o()(y.Z,m);y.Z&&y.Z.locals&&y.Z.locals;var h=function n(){e(this,n)}}(),r}()}));
//# sourceMappingURL=myBundle.min.js.map"
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' boolean option) 1`] = `
Object {
"status": 0,
"stdall": "
[__:__:__] Starting Crafty __version__...
[__:__:__] Files will be stored in:
css: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/extract-boolean/dist/css
js: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/extract-boolean/dist/js
[__:__:__] Starting 'default' ...
[__:__:__] Starting 'js' ...
[__:__:__] Starting 'js_myBundle' ...
asset myBundle.min.js ___ bytes [emitted] [minimized] (name: default)
sourceMap myBundle.min.js.map ___ KiB [emitted] [dev] (auxiliary name: default)
asset myBundle-default.min.css ___ bytes [emitted] (name: default)
sourceMap myBundle-default.min.css.map ___ KiB [emitted] [dev] (auxiliary name: default)
Entrypoint default ___ KiB (___ KiB) = myBundle-default.min.css ___ bytes myBundle.min.js ___ bytes 2 auxiliary assets
chunk (runtime: default) myBundle-default.min.css, myBundle.min.js (default) ___ bytes (javascript) ___ bytes (css/mini-extract) ___ bytes (runtime) [entry] [rendered]
runtime modules ___ bytes 3 modules
dependent modules ___ bytes [dependent] 1 module
./js/app.js + 1 modules ___ bytes [built] [code generated]
Compiled successfully!
Δt ____ms
[__:__:__] Finished 'js_myBundle' after ____ ms
[__:__:__] Finished 'js' after ____ ms
[__:__:__] Finished 'default' after ____ ms
",
}
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' boolean option) 2`] = `
"(function(e,t){if(\\"object\\"===typeof exports&&\\"object\\"===typeof module)module.exports=t();else if(\\"function\\"===typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)(\\"object\\"===typeof exports?exports:e)[n]=o[n]}})(self,(function(){return function(){\\"use strict\\";var e={};e.d=function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){\\"undefined\\"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})};var t={};function o(e,t){if(!(e instanceof t))throw new TypeError(\\"Cannot call a class as a function\\")}e.r(t),e.d(t,{default:function(){return n}});var n=function e(){o(this,e)};return t}()}));
//# sourceMappingURL=myBundle.min.js.map"
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' boolean option) 3`] = `
"a{color:#00f}.Child{background:#000}.Parent{background:#fff}.Parent--before{color:#333}.Parent--after{color:#eee}.Button{color:orange}.Menu{width:800px}.MenuLink{color:red;background:#056ef0;width:200px}
/*# sourceMappingURL=myBundle-default.min.css.map*/"
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' object option) 1`] = `
Object {
"status": 0,
"stdall": "
[__:__:__] Starting Crafty __version__...
[__:__:__] Files will be stored in:
css: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/extract-object/dist/css
js: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/extract-object/dist/js
[__:__:__] Starting 'default' ...
[__:__:__] Starting 'js' ...
[__:__:__] Starting 'js_myBundle' ...
asset myBundle.min.js ___ bytes [emitted] [minimized] (name: default)
sourceMap myBundle.min.js.map ___ KiB [emitted] [dev] (auxiliary name: default)
asset myBundle-object.min.css ___ bytes [emitted] (name: default)
sourceMap myBundle-object.min.css.map ___ KiB [emitted] [dev] (auxiliary name: default)
Entrypoint default ___ KiB (___ KiB) = myBundle-object.min.css ___ bytes myBundle.min.js ___ bytes 2 auxiliary assets
chunk (runtime: default) myBundle-object.min.css, myBundle.min.js (default) ___ bytes (javascript) ___ bytes (css/mini-extract) ___ bytes (runtime) [entry] [rendered]
runtime modules ___ bytes 3 modules
dependent modules ___ bytes [dependent] 1 module
./js/app.js + 1 modules ___ bytes [built] [code generated]
Compiled successfully!
Δt ____ms
[__:__:__] Finished 'js_myBundle' after ____ ms
[__:__:__] Finished 'js' after ____ ms
[__:__:__] Finished 'default' after ____ ms
",
}
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' object option) 2`] = `
"(function(e,t){if(\\"object\\"===typeof exports&&\\"object\\"===typeof module)module.exports=t();else if(\\"function\\"===typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)(\\"object\\"===typeof exports?exports:e)[n]=o[n]}})(self,(function(){return function(){\\"use strict\\";var e={};e.d=function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){\\"undefined\\"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})};var t={};function o(e,t){if(!(e instanceof t))throw new TypeError(\\"Cannot call a class as a function\\")}e.r(t),e.d(t,{default:function(){return n}});var n=function e(){o(this,e)};return t}()}));
//# sourceMappingURL=myBundle.min.js.map"
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' object option) 3`] = `
"a{color:#00f}.Child{background:#000}.Parent{background:#fff}.Parent--before{color:#333}.Parent--after{color:#eee}.Button{color:orange}.Menu{width:800px}.MenuLink{color:red;background:#056ef0;width:200px}
/*# sourceMappingURL=myBundle-object.min.css.map*/"
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' string option) 1`] = `
Object {
"status": 0,
"stdall": "
[__:__:__] Starting Crafty __version__...
[__:__:__] Files will be stored in:
css: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/extract-string/dist/css
js: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/extract-string/dist/js
[__:__:__] Starting 'default' ...
[__:__:__] Starting 'js' ...
[__:__:__] Starting 'js_myBundle' ...
asset myBundle.min.js ___ bytes [emitted] [minimized] (name: default)
sourceMap myBundle.min.js.map ___ KiB [emitted] [dev] (auxiliary name: default)
asset myBundle-string.min.css ___ bytes [emitted] (name: default)
sourceMap myBundle-string.min.css.map ___ KiB [emitted] [dev] (auxiliary name: default)
Entrypoint default ___ KiB (___ KiB) = myBundle-string.min.css ___ bytes myBundle.min.js ___ bytes 2 auxiliary assets
chunk (runtime: default) myBundle-string.min.css, myBundle.min.js (default) ___ bytes (javascript) ___ bytes (css/mini-extract) ___ bytes (runtime) [entry] [rendered]
runtime modules ___ bytes 3 modules
dependent modules ___ bytes [dependent] 1 module
./js/app.js + 1 modules ___ bytes [built] [code generated]
Compiled successfully!
Δt ____ms
[__:__:__] Finished 'js_myBundle' after ____ ms
[__:__:__] Finished 'js' after ____ ms
[__:__:__] Finished 'default' after ____ ms
",
}
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' string option) 2`] = `
"(function(e,t){if(\\"object\\"===typeof exports&&\\"object\\"===typeof module)module.exports=t();else if(\\"function\\"===typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)(\\"object\\"===typeof exports?exports:e)[n]=o[n]}})(self,(function(){return function(){\\"use strict\\";var e={};e.d=function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){\\"undefined\\"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})};var t={};function o(e,t){if(!(e instanceof t))throw new TypeError(\\"Cannot call a class as a function\\")}e.r(t),e.d(t,{default:function(){return n}});var n=function e(){o(this,e)};return t}()}));
//# sourceMappingURL=myBundle.min.js.map"
`;
exports[`Compiles CSS within webpack, extracts CSS ('extractCSS' string option) 3`] = `
"a{color:#00f}.Child{background:#000}.Parent{background:#fff}.Parent--before{color:#333}.Parent--after{color:#eee}.Button{color:orange}.Menu{width:800px}.MenuLink{color:red;background:#056ef0;width:200px}
/*# sourceMappingURL=myBundle-string.min.css.map*/"
`;
exports[`Fails gracefully on broken markup 1`] = `
Object {
"status": 1,
"stdall": "
[__:__:__] Starting Crafty __version__...
[__:__:__] Files will be stored in:
css: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/fails/dist/css
js: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/fails/dist/js
[__:__:__] Starting 'default' ...
[__:__:__] Starting 'js' ...
[__:__:__] Starting 'js_myBundle' ...
assets by status ___ KiB [cached] 1 asset
Entrypoint default = myBundle.min.js 1 auxiliary asset
chunk (runtime: default) myBundle.min.js (default) ___ KiB (javascript) ___ bytes (runtime) [entry] [rendered]
dependent modules ___ KiB [dependent] 7 modules
runtime modules ___ bytes 4 modules
./js/app.js + 2 modules ___ KiB [built] [code generated]
Failed to compile.
Syntax error: __PATH__/packages/integration/fixtures/crafty-preset-postcss-webpack/fails/css/style.scss Unknown word (10:13)
8 | @at-root {
9 | .Child
> 10 | background: black;
| ^
11 | }
12 | }
Δt ____ms ✖ 1 problem (1 error, 0 warnings)
[__:__:__] 'js_myBundle' errored after ____ ms
[__:__:__] Webpack compilation failed
[__:__:__] 'js' errored after ____ ms
[__:__:__] 'default' errored after ____ ms
",
}
`;