Skip to content

Commit

Permalink
attempt to get 'import axios' working, follup on PR 34
Browse files Browse the repository at this point in the history
  • Loading branch information
leob committed Nov 30, 2024
1 parent cbdc4f8 commit a2e4c44
Show file tree
Hide file tree
Showing 4 changed files with 1,261 additions and 1,197 deletions.
1 change: 1 addition & 0 deletions js-src/Websocket.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AxiosResponse } from "axios";
import { Channel } from "./Channel";
import axios from 'axios';

export type Options = { authEndpoint: string, host: string, bearerToken: string, auth: any, debug: boolean };

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"laravel-echo": "^1.10.0",
"mock-socket": "^9.0.3",
"rollup": "^2.10.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript2": "^0.27.1",
"standard-version": "^8.0.1",
"ts-jest": "^24.1.0",
Expand Down
13 changes: 13 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import babel from '@rollup/plugin-babel';
import typescript from 'rollup-plugin-typescript2';

import rollupNodeResolve from 'rollup-plugin-node-resolve';
import rollupJson from 'rollup-plugin-json';
import rollupCommonjs from 'rollup-plugin-commonjs';

export default {
input: './js-src/Connector.ts',
output: [
Expand All @@ -9,6 +13,15 @@ export default {
{ file: './dist/laravel-echo-api-gateway.iife.js', format: 'iife', name: 'LaravelEchoApiGateway' },
],
plugins: [
rollupCommonjs({
include: 'node_modules/axios/**'
}),
rollupNodeResolve({
jsnext: true,
preferBuiltins: true,
browser: true
}),
rollupJson(),
typescript(),
babel({
babelHelpers: 'bundled',
Expand Down
Loading

0 comments on commit a2e4c44

Please sign in to comment.