mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-06-24 21:31:32 +00:00
feat(js-client)!: Adding strictes eslint and ts config to all packages [fixes DXJ-464] (#355)
* introduce eslint * Fix all eslint errors * Eslint fix and some touches * Fix tests * Fix misc errors * change semver * change semver #2 * Fix path * Fix path #2 * freeze lock file in CI * fix package install * Fix formatting of surrounding files * Add empty prettier config * Fix formatting * Fix build errors * Remove unused deps * remove changelog from formatting * deps cleanup * make resource importers async * Refactor * Fix error message * remove comment * more refactoring * Update packages/core/js-client/src/compilerSupport/registerService.ts Co-authored-by: shamsartem <shamsartem@gmail.com> * refactoring * refactoring fix * optimize import * Update packages/@tests/smoke/node/src/index.ts Co-authored-by: shamsartem <shamsartem@gmail.com> * Revert package * Fix pnpm lock * Lint-fix * Fix CI * Update tests * Fix build * Fix import * Use forked threads dep * Use fixed version * Update threads * Fix lint * Fix test * Fix test * Add polyfill for assert * Add subpath import * Fix tests * Fix deps --------- Co-authored-by: shamsartem <shamsartem@gmail.com>
This commit is contained in:
@ -14,46 +14,50 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import inject from '@rollup/plugin-inject';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
import { createRequire } from 'module';
|
||||
import { readFileSync } from 'fs';
|
||||
import inject from "@rollup/plugin-inject";
|
||||
import tsconfigPaths from "vite-tsconfig-paths";
|
||||
import { createRequire } from "module";
|
||||
import { readFileSync } from "fs";
|
||||
import { UserConfig } from "vite";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const esbuildShim = require.resolve('node-stdlib-browser/helpers/esbuild/shim');
|
||||
const esbuildShim = require.resolve("node-stdlib-browser/helpers/esbuild/shim");
|
||||
|
||||
export default {
|
||||
build: {
|
||||
target: 'modules',
|
||||
minify: 'esbuild',
|
||||
lib: {
|
||||
entry: './src/index.ts',
|
||||
name: 'js-client',
|
||||
fileName: 'index',
|
||||
const config: UserConfig = {
|
||||
build: {
|
||||
target: "modules",
|
||||
minify: "esbuild",
|
||||
lib: {
|
||||
entry: "./src/index.ts",
|
||||
name: "js-client",
|
||||
fileName: "index",
|
||||
},
|
||||
outDir: "./dist/browser",
|
||||
rollupOptions: {
|
||||
plugins: [
|
||||
{
|
||||
// @ts-ignore
|
||||
...inject({
|
||||
global: [esbuildShim, "global"],
|
||||
process: [esbuildShim, "process"],
|
||||
Buffer: [esbuildShim, "Buffer"],
|
||||
}),
|
||||
enforce: "post",
|
||||
},
|
||||
outDir: './dist/browser',
|
||||
rollupOptions: {
|
||||
plugins: [
|
||||
{
|
||||
// @ts-ignore
|
||||
...inject({
|
||||
global: [esbuildShim, 'global'],
|
||||
process: [esbuildShim, 'process'],
|
||||
Buffer: [esbuildShim, 'Buffer']
|
||||
}), enforce: 'post'
|
||||
}
|
||||
],
|
||||
}
|
||||
],
|
||||
},
|
||||
plugins: [tsconfigPaths()],
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
define: {
|
||||
global: 'globalThis',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [tsconfigPaths()],
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
define: {
|
||||
global: "globalThis",
|
||||
},
|
||||
},
|
||||
define: {
|
||||
__PACKAGE_JSON_CONTENT__: readFileSync('./package.json', 'utf-8')
|
||||
},
|
||||
}
|
||||
},
|
||||
define: {
|
||||
__PACKAGE_JSON_CONTENT__: readFileSync("./package.json", "utf-8"),
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
Reference in New Issue
Block a user