If you have to extend an existing object with additional property, always prefer Vue.set()
over Object.assign()
(or spread operator).
Example below explains implications for different implementations.
// yarn add --dev @esbuild-plugins/node-globals-polyfill | |
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill' | |
// yarn add --dev @esbuild-plugins/node-modules-polyfill | |
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill' | |
// You don't need to add this to deps, it's included by @esbuild-plugins/node-modules-polyfill | |
import rollupNodePolyFill from 'rollup-plugin-node-polyfills' | |
export default { | |
resolve: { | |
alias: { |
// @ts-nocheck //TODO: enable remove once there are typings in place | |
// TODO: uncomment all three eslint() occurrences once eslint warnings and errors are fixed | |
// for info on emitCSS etc. https://github.com/rollup/rollup-plugin-svelte#extracting-css and https://svelte.dev/docs#svelte_preprocess | |
// import { eslint } from 'rollup-plugin-eslint' | |
import { terser } from 'rollup-plugin-terser' | |
import babel from 'rollup-plugin-babel' | |
import commonjs from 'rollup-plugin-commonjs' | |
import config from 'sapper/config/rollup.js' | |
import environmentVariables from './config/env' |
<? | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php"); | |
$APPLICATION->SetTitle("Тестирование"); | |
CModule::IncludeModule('gpw.testing'); | |
CModule::IncludeModule('im'); | |
CModule::IncludeModule('bizproc'); | |
$iTemplateID = XXX; |
<? | |
error_reporting(E_ALL & ~E_NOTICE); | |
if(version_compare(phpversion(), '5.0.0') == -1) | |
die('PHP 5.0.0 or higher is required!'); | |
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php'); | |
header("Content-type: text/html; charset=cp1251"); | |
echo '<html><head><title>Конвертация сайта в UTF8</title></head><body>'; |
<? | |
CModule::IncludeModule('crm'); | |
CModule::IncludeModule('gpw.1cdb'); | |
CModule::IncludeModule('gpw.payments'); | |
require_once($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/csv_data.php"); | |
$csvFile = new CCSVData('R', true); | |
$csvFile->LoadFile($_SERVER['DOCUMENT_ROOT'] . '/testing/file.csv'); | |
$csvFile->SetDelimiter(';'); |
function loadImages(paths,whenLoaded){ | |
var imgs=[]; | |
paths.forEach(function(path){ | |
var img = new Image; | |
img.onload = function(){ | |
imgs.push(img); | |
if (imgs.length==paths.length) whenLoaded(imgs); | |
} | |
img.src = path; | |
}); |
function copyFbRecord(oldRef, newRef) { | |
return Promise((resolve, reject) => { | |
oldRef.once('value').then(snap => { | |
return newRef.set(snap.val()); | |
}).then(() => { | |
console.log('Done!'); | |
resolve(); | |
}).catch(err => { | |
console.log(err.message); | |
reject(); |
const webpack = require('webpack') | |
const fs = require('fs') | |
// NODE_ENV | |
const nodeEnv = process.env.NODE_ENV || 'development' | |
const isProd = nodeEnv === 'production' | |
module.exports = (options) => { | |
let entryFile, outputPath, isClient, isServer |
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var noVisualization = process.env.NODE_ENV === 'production' | |
|| process.argv.slice(-1)[0] == '-p' | |
|| process.argv.some(arg => arg.indexOf('webpack-dev-server') >= 0); | |
module.exports = { | |
entry: { | |
main: './reactStartup.js' |