Skip to content

Commit a2e4c44

Browse files
committed
attempt to get 'import axios' working, follup on PR 34
1 parent cbdc4f8 commit a2e4c44

File tree

4 files changed

+1261
-1197
lines changed

4 files changed

+1261
-1197
lines changed

js-src/Websocket.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AxiosResponse } from "axios";
22
import { Channel } from "./Channel";
3+
import axios from 'axios';
34

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"laravel-echo": "^1.10.0",
5252
"mock-socket": "^9.0.3",
5353
"rollup": "^2.10.2",
54+
"rollup-plugin-commonjs": "^10.1.0",
55+
"rollup-plugin-json": "^4.0.0",
56+
"rollup-plugin-node-resolve": "^5.2.0",
5457
"rollup-plugin-typescript2": "^0.27.1",
5558
"standard-version": "^8.0.1",
5659
"ts-jest": "^24.1.0",

rollup.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import babel from '@rollup/plugin-babel';
22
import typescript from 'rollup-plugin-typescript2';
33

4+
import rollupNodeResolve from 'rollup-plugin-node-resolve';
5+
import rollupJson from 'rollup-plugin-json';
6+
import rollupCommonjs from 'rollup-plugin-commonjs';
7+
48
export default {
59
input: './js-src/Connector.ts',
610
output: [
@@ -9,6 +13,15 @@ export default {
913
{ file: './dist/laravel-echo-api-gateway.iife.js', format: 'iife', name: 'LaravelEchoApiGateway' },
1014
],
1115
plugins: [
16+
rollupCommonjs({
17+
include: 'node_modules/axios/**'
18+
}),
19+
rollupNodeResolve({
20+
jsnext: true,
21+
preferBuiltins: true,
22+
browser: true
23+
}),
24+
rollupJson(),
1225
typescript(),
1326
babel({
1427
babelHelpers: 'bundled',

0 commit comments

Comments
 (0)