mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-29 09:02:03 +00:00
@@ -24,11 +24,6 @@ module.exports = {
|
|||||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
|
||||||
'process.env.__REACT_NATIVE_DEBUG_ENABLED__': DEV
|
'process.env.__REACT_NATIVE_DEBUG_ENABLED__': DEV
|
||||||
}),
|
}),
|
||||||
// https://github.com/animatedjs/animated/issues/40
|
|
||||||
new webpack.NormalModuleReplacementPlugin(
|
|
||||||
/es6-set/,
|
|
||||||
path.join(__dirname, '../../src/modules/polyfills/Set.js')
|
|
||||||
),
|
|
||||||
new webpack.optimize.OccurenceOrderPlugin()
|
new webpack.optimize.OccurenceOrderPlugin()
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
"test:watch": "npm run test:jest -- --watch"
|
"test:watch": "npm run test:jest -- --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"animated": "^0.1.3",
|
"animated": "^0.1.5",
|
||||||
"array-find-index": "^1.0.2",
|
"array-find-index": "^1.0.2",
|
||||||
"asap": "^2.0.5",
|
"asap": "^2.0.5",
|
||||||
"babel-runtime": "^6.11.6",
|
"babel-runtime": "^6.11.6",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import asap from 'asap';
|
import asap from 'asap';
|
||||||
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';
|
|
||||||
|
|
||||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ const getStyleText = () => {
|
|||||||
|
|
||||||
// TODO: SSR support
|
// TODO: SSR support
|
||||||
const getAvailableClassNames = () => {
|
const getAvailableClassNames = () => {
|
||||||
if (ExecutionEnvironment.canUseDOM) {
|
if (global.document) {
|
||||||
if (!styleNode) {
|
if (!styleNode) {
|
||||||
styleNode = document.getElementById(STYLE_ELEMENT_ID);
|
styleNode = document.getElementById(STYLE_ELEMENT_ID);
|
||||||
}
|
}
|
||||||
@@ -45,8 +44,7 @@ const getAvailableClassNames = () => {
|
|||||||
const createStyleHTML = (text) => `<style id="${STYLE_ELEMENT_ID}">${text}</style>`;
|
const createStyleHTML = (text) => `<style id="${STYLE_ELEMENT_ID}">${text}</style>`;
|
||||||
|
|
||||||
const frame = () => {
|
const frame = () => {
|
||||||
if (!isDirty || !ExecutionEnvironment.canUseDOM) { return; }
|
if (!isDirty || !global.document) { return; }
|
||||||
|
|
||||||
isDirty = false;
|
isDirty = false;
|
||||||
styleNode = styleNode || document.getElementById(STYLE_ELEMENT_ID);
|
styleNode = styleNode || document.getElementById(STYLE_ELEMENT_ID);
|
||||||
|
|
||||||
@@ -74,7 +72,7 @@ const addRule = (key, rule) => {
|
|||||||
registry[key] = rule;
|
registry[key] = rule;
|
||||||
if (!isDirty) {
|
if (!isDirty) {
|
||||||
isDirty = true;
|
isDirty = true;
|
||||||
if (ExecutionEnvironment.canUseDOM) {
|
if (global.document) {
|
||||||
asap(frame);
|
asap(frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
function SetPolyfill() { this._cache = []; }
|
|
||||||
SetPolyfill.prototype.add = function (e) {
|
|
||||||
if (this._cache.indexOf(e) === -1) { this._cache.push(e); }
|
|
||||||
};
|
|
||||||
SetPolyfill.prototype.forEach = function (cb) {
|
|
||||||
this._cache.forEach(cb);
|
|
||||||
};
|
|
||||||
module.exports = SetPolyfill;
|
|
||||||
@@ -31,11 +31,6 @@ module.exports = {
|
|||||||
}),
|
}),
|
||||||
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
|
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
|
||||||
new webpack.optimize.DedupePlugin(),
|
new webpack.optimize.DedupePlugin(),
|
||||||
// https://github.com/animatedjs/animated/issues/40
|
|
||||||
new webpack.NormalModuleReplacementPlugin(
|
|
||||||
/es6-set/,
|
|
||||||
path.join(__dirname, 'dist/modules/polyfills/Set.js')
|
|
||||||
),
|
|
||||||
new webpack.optimize.OccurenceOrderPlugin(),
|
new webpack.optimize.OccurenceOrderPlugin(),
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
compress: {
|
compress: {
|
||||||
|
|||||||
@@ -181,13 +181,12 @@ amdefine@>=0.0.4:
|
|||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
|
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
|
||||||
|
|
||||||
animated@^0.1.3:
|
animated@^0.1.5:
|
||||||
version "0.1.4"
|
version "0.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/animated/-/animated-0.1.4.tgz#1e7d119ea0027e1279b96ec309f5cb54935a915a"
|
resolved "https://registry.yarnpkg.com/animated/-/animated-0.1.5.tgz#83df8dc443d57abab7b0bb04818b0b655b31c9b9"
|
||||||
dependencies:
|
dependencies:
|
||||||
es6-set "^0.1.4"
|
|
||||||
invariant "^2.2.0"
|
invariant "^2.2.0"
|
||||||
tinycolor "0.0.1"
|
normalize-css-color "^1.0.1"
|
||||||
|
|
||||||
ansi-escapes@^1.1.0, ansi-escapes@^1.4.0:
|
ansi-escapes@^1.1.0, ansi-escapes@^1.4.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
@@ -2045,7 +2044,7 @@ es6-map@^0.1.3:
|
|||||||
es6-symbol "~3.1.0"
|
es6-symbol "~3.1.0"
|
||||||
event-emitter "~0.3.4"
|
event-emitter "~0.3.4"
|
||||||
|
|
||||||
es6-set@^0.1.4, es6-set@~0.1.3:
|
es6-set@~0.1.3:
|
||||||
version "0.1.4"
|
version "0.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8"
|
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -4017,6 +4016,10 @@ nopt@3.x, nopt@~3.0.6:
|
|||||||
dependencies:
|
dependencies:
|
||||||
abbrev "1"
|
abbrev "1"
|
||||||
|
|
||||||
|
normalize-css-color@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/normalize-css-color/-/normalize-css-color-1.0.1.tgz#792f59cae25036950a9127cfcfddc073048f4f9d"
|
||||||
|
|
||||||
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
|
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4:
|
||||||
version "2.3.5"
|
version "2.3.5"
|
||||||
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df"
|
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df"
|
||||||
@@ -5452,10 +5455,6 @@ timers-browserify@^1.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
process "~0.11.0"
|
process "~0.11.0"
|
||||||
|
|
||||||
tinycolor@0.0.1:
|
|
||||||
version "0.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/tinycolor/-/tinycolor-0.0.1.tgz#320b5a52d83abb5978d81a3e887d4aefb15a6164"
|
|
||||||
|
|
||||||
tmpl@1.0.x:
|
tmpl@1.0.x:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
|
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
|
||||||
|
|||||||
Reference in New Issue
Block a user