add rollup commonjs plugin
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
"puppeteer": "^1.9.0",
|
"puppeteer": "^1.9.0",
|
||||||
"rollup": "^0.66.6",
|
"rollup": "^0.66.6",
|
||||||
|
"rollup-plugin-commonjs": "^9.2.0",
|
||||||
"rollup-plugin-node-resolve": "^3.4.0",
|
"rollup-plugin-node-resolve": "^3.4.0",
|
||||||
"rollup-plugin-postcss": "^1.6.2",
|
"rollup-plugin-postcss": "^1.6.2",
|
||||||
"rollup-plugin-terser": "^3.0.0",
|
"rollup-plugin-terser": "^3.0.0",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import typescript from 'rollup-plugin-typescript';
|
import typescript from 'rollup-plugin-typescript';
|
||||||
|
import commonjs from 'rollup-plugin-commonjs';
|
||||||
import resolve from 'rollup-plugin-node-resolve';
|
import resolve from 'rollup-plugin-node-resolve';
|
||||||
import { terser } from 'rollup-plugin-terser';
|
import { terser } from 'rollup-plugin-terser';
|
||||||
import postcss from 'rollup-plugin-postcss';
|
import postcss from 'rollup-plugin-postcss';
|
||||||
@@ -18,7 +19,7 @@ let configs = [
|
|||||||
// browser(record only)
|
// browser(record only)
|
||||||
{
|
{
|
||||||
input: './src/record/index.ts',
|
input: './src/record/index.ts',
|
||||||
plugins: [typescript(), resolve()],
|
plugins: [resolve(), commonjs(), typescript()],
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
name: 'rrwebRecord',
|
name: 'rrwebRecord',
|
||||||
@@ -29,7 +30,7 @@ let configs = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: './src/record/index.ts',
|
input: './src/record/index.ts',
|
||||||
plugins: [typescript(), resolve(), terser()],
|
plugins: [resolve(), commonjs(), typescript(), terser()],
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
name: 'rrwebRecord',
|
name: 'rrwebRecord',
|
||||||
@@ -42,7 +43,7 @@ let configs = [
|
|||||||
// CommonJS(record only)
|
// CommonJS(record only)
|
||||||
{
|
{
|
||||||
input: './src/record/index.ts',
|
input: './src/record/index.ts',
|
||||||
plugins: [typescript(), resolve()],
|
plugins: [resolve(), commonjs(), typescript()],
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
@@ -53,7 +54,7 @@ let configs = [
|
|||||||
// ES module(record only)
|
// ES module(record only)
|
||||||
{
|
{
|
||||||
input: './src/record/index.ts',
|
input: './src/record/index.ts',
|
||||||
plugins: [typescript(), resolve()],
|
plugins: [resolve(), commonjs(), typescript()],
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
@@ -63,7 +64,7 @@ let configs = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: './src/record/index.ts',
|
input: './src/record/index.ts',
|
||||||
plugins: [typescript(), resolve(), terser()],
|
plugins: [resolve(), commonjs(), typescript(), terser()],
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
@@ -76,8 +77,9 @@ let configs = [
|
|||||||
{
|
{
|
||||||
input: './src/index.ts',
|
input: './src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: false,
|
extract: false,
|
||||||
inject: false,
|
inject: false,
|
||||||
@@ -94,8 +96,9 @@ let configs = [
|
|||||||
{
|
{
|
||||||
input: './src/index.ts',
|
input: './src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: true,
|
extract: true,
|
||||||
minimize: true,
|
minimize: true,
|
||||||
@@ -116,8 +119,9 @@ let configs = [
|
|||||||
{
|
{
|
||||||
input: './src/index.ts',
|
input: './src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: false,
|
extract: false,
|
||||||
inject: false,
|
inject: false,
|
||||||
@@ -134,8 +138,9 @@ let configs = [
|
|||||||
{
|
{
|
||||||
input: './src/index.ts',
|
input: './src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: false,
|
extract: false,
|
||||||
inject: false,
|
inject: false,
|
||||||
@@ -151,8 +156,9 @@ let configs = [
|
|||||||
{
|
{
|
||||||
input: './src/index.ts',
|
input: './src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: false,
|
extract: false,
|
||||||
inject: false,
|
inject: false,
|
||||||
@@ -173,8 +179,9 @@ if (process.env.BROWSER_ONLY) {
|
|||||||
configs = {
|
configs = {
|
||||||
input: './src/index.ts',
|
input: './src/index.ts',
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript(),
|
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript(),
|
||||||
postcss({
|
postcss({
|
||||||
extract: true,
|
extract: true,
|
||||||
minimize: true,
|
minimize: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user