Skip to content

Commit

Permalink
fix(csv-demo-webpack-ts): remove polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Dec 29, 2021
1 parent 624c62d commit 47a99bd
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion demo/webpack-ts/src/generate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import {generate} from 'csv-generate';
import {generate} from 'csv-generate/browser/esm/index.js';

window.onload = () => {
const runEl = document.getElementById('run');
Expand Down
2 changes: 1 addition & 1 deletion demo/webpack-ts/src/parse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { parse, CsvError } from 'csv-parse'
import { parse, CsvError } from 'csv-parse/browser/esm/index.js'

window.onload = () => {
const runEl = document.getElementById('run');
Expand Down
2 changes: 1 addition & 1 deletion demo/webpack-ts/src/stringify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import {stringify} from 'csv-stringify';
import {stringify} from 'csv-stringify/browser/esm/index.js';

window.onload = () => {
const runEl = document.getElementById('run');
Expand Down
2 changes: 1 addition & 1 deletion demo/webpack-ts/src/transform.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import {transform} from 'stream-transform';
import {transform} from 'stream-transform/browser/esm/index.js';

window.onload = () => {
const runEl = document.getElementById('run');
Expand Down
27 changes: 4 additions & 23 deletions demo/webpack-ts/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const path = require('path');
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")

const config = (mod, fallbacks={}) => ({
entry: `./src/${mod}.ts`,
mode: 'development',
plugins: [new NodePolyfillPlugin()],
module: {
rules: [
{
Expand All @@ -16,13 +14,6 @@ const config = (mod, fallbacks={}) => ({
},
resolve: {
extensions: ['.ts', '.js'],
// fallback: {
// // ...{
// // "stream": require.resolve("stream-browserify"),
// // "buffer": false,
// // },
// // ...fallbacks
// }
},
output: {
filename: `${mod}.js`,
Expand All @@ -31,18 +22,8 @@ const config = (mod, fallbacks={}) => ({
})

module.exports = [
config('generate', {
// "util": require.resolve("util"),
"util": false,
}),
config('parse', {
// "buffer": require.resolve("buffer/"),
"buffer": false,
}),
config('stringify', {
}),
config('transform', {
// "util": require.resolve("util/"),
"util": false,
}),
config('generate'),
config('parse'),
config('stringify'),
config('transform'),
];
3 changes: 3 additions & 0 deletions packages/csv-generate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
],
"sync": [
"dist/esm/sync.d.ts"
],
"browser/esm/*": [
"dist/esm/*"
]
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/csv-parse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
],
"sync": [
"dist/esm/sync.d.ts"
],
"browser/esm/*": [
"dist/esm/*"
]
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/csv-stringify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
],
"sync": [
"dist/esm/sync.d.ts"
],
"browser/esm/*": [
"dist/esm/*"
]
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/stream-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
],
"sync": [
"dist/esm/sync.d.ts"
],
"browser/esm/*": [
"dist/esm/*"
]
}
}
Expand Down

0 comments on commit 47a99bd

Please sign in to comment.