rollup

Calculating multiple averages across different parts of the table?

安稳与你 提交于 2021-02-11 13:12:16
问题 I have the following transactions table: customer_id purchase_date product category department quantity store_id 1 2020-10-01 Kit Kat Candy Food 2 store_A 1 2020-10-01 Snickers Candy Food 1 store_A 1 2020-10-01 Snickers Candy Food 1 store_A 2 2020-10-01 Snickers Candy Food 2 store_A 2 2020-10-01 Baguette Bread Food 5 store_A 2 2020-10-01 iPhone Cell phones Electronics 2 store_A 3 2020-10-01 Sony PS5 Games Electronics 1 store_A I would like to calculate the average number of products purchased

Optimizing query with multiple sums?

删除回忆录丶 提交于 2021-02-10 15:46:26
问题 I have table products : +----------+-----------+----------+---------+ |family_id |shopper_id |product_id|quantity | +----------+-----------+----------+---------+ |A |1 |Kit Kat |10 | |A |1 |Kit Kat |5 | |A |1 |Snickers |9 | |A |2 |Kit Kat |7 | |B |3 |Kit Kat |2 | +----------+---------- +----------+---------+ For each product, I want to calculate 2 totals: total quantity per shopper total quantity per family. Sum of total quantities for all shoppers in the same family. The final table should

Creating a standalone web component build using as an IIFE

房东的猫 提交于 2021-01-29 11:26:44
问题 I have create a web component for displaying gists generally in any html content. I used the Lit Element Typescript Starter Project as a baseline and it comes with a rollup.config.js file. I changed the output format to iife and left the rest the same, with exception of the component and bundle names. The reason I did this is that I wanted the bundle to be easily accessible via script tags, and rollup says that the iife format does this. This is the modified rollup.config.js file. // ========

Bundling a plugin with Rollup but having duplicate Vue.js package imported in the client app's bundle (Nuxt)

…衆ロ難τιáo~ 提交于 2021-01-28 17:49:26
问题 Dear Stack Overflow / Vue.js / Rollup community This could be a noob question for the master plugin developers working with Vue and Rollup. I will write the question very explicitly hoping that it could help other noobs like me in the future. I have simple plugin that helps with form validation. One of the components in this plugin imports Vue in order to programatically create a component and append to DOM on mount like below: import Vue from 'vue' import Notification from './Notification

Using rollup in combination with babel and commonjs plugins doesn't resolve all modules

末鹿安然 提交于 2021-01-27 17:18:32
问题 I'm using rollup with the Babel and CommonJS plugins, like this: const inputOptions = { input: "...", plugins: [ resolve(), babel({ exclude: "node_modules/**", externalHelpers: true, include: "**/components/**/*.js", }), commonjs(), ], }; But what happens is that modules referenced from components don't seem to be recognized by the CommonJS plugin, they end up as plain require(...) statements in the output (just like the source input) where of course they cannot be resolved. Modules imported

Output Single HTML File from Svelte Project

梦想的初衷 提交于 2021-01-27 14:52:38
问题 I can't find any example anywhere online that shows how to (or if we can) output a single HTML file from a Svelte project using Rollup (not Webpack), containing all CSS and JS injected inline (and not as URLs in script). 回答1: There is no built-in way to achieve this, so you'll have to write your own plugin to do so. This code is some sort of an attemt to get this done and could act as a starter point. It is in no way actually complete or good. (to be honest I doubt you will be winning any

Output Single HTML File from Svelte Project

隐身守侯 提交于 2021-01-27 14:41:22
问题 I can't find any example anywhere online that shows how to (or if we can) output a single HTML file from a Svelte project using Rollup (not Webpack), containing all CSS and JS injected inline (and not as URLs in script). 回答1: There is no built-in way to achieve this, so you'll have to write your own plugin to do so. This code is some sort of an attemt to get this done and could act as a starter point. It is in no way actually complete or good. (to be honest I doubt you will be winning any

How to build a component library using TypeScript, Ant Design and Rollup

谁都会走 提交于 2021-01-24 12:26:55
问题 I'm trying to create an example boilerplate for a library of reusable components in TypeScript, using Ant Design for UI elements and Rollup for bundling. The Ant Design documentation although useful, doesn't give specific details for configuring Rollup and I've not had any luck finding an example using the same technology stack. Using information from various online sources I've put together an outline boilerplate and published it to the following GitHub repository However, the build output

Importing from subfolders for a javascript package

拜拜、爱过 提交于 2020-12-13 03:27:57
问题 I have a typescript library consists of multiple folders. Each folder contains an index.ts file which exports some business logic. I am trying to bundle this with rollup to achieve this behavior on the call site: import { Button, ButtonProps } from 'my-lib/button' import { Input, Textarea } from 'my-lib/input' import { Row, Column } from 'my-lib/grid' This is the directory structure: I have a main index.ts under src/ which contains: export * from './button'; export * from './input'; export *

Importing from subfolders for a javascript package

十年热恋 提交于 2020-12-13 03:27:54
问题 I have a typescript library consists of multiple folders. Each folder contains an index.ts file which exports some business logic. I am trying to bundle this with rollup to achieve this behavior on the call site: import { Button, ButtonProps } from 'my-lib/button' import { Input, Textarea } from 'my-lib/input' import { Row, Column } from 'my-lib/grid' This is the directory structure: I have a main index.ts under src/ which contains: export * from './button'; export * from './input'; export *