Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Feb 8, 2025
1 parent 8eed818 commit d0f356f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 39 deletions.
7 changes: 3 additions & 4 deletions ipecharts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"load_extensions": {
"ipecharts/extension": true
}
"load_extensions": {
"ipecharts/extension": true
}
}
29 changes: 14 additions & 15 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@

// Configure requirejs
if (window.require) {
// @ts-ignore
window.require.config({
map: {
"*": {
"ipecharts": "nbextensions/ipecharts/index",
},
},
});
}

// Export the required load_ipython_extension
module.exports = {
load_ipython_extension() {},
};

// @ts-ignore
window.require.config({
map: {
'*': {
ipecharts: 'nbextensions/ipecharts/index'
}
}
});
}

// Export the required load_ipython_extension
module.exports = {
load_ipython_extension() {}
};
3 changes: 1 addition & 2 deletions src/notebook.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is the entry point for the notebook extension,
// We only export a subset of the things we do in index.ts, since
// We only export a subset of the things we do in index.ts, since
// certain exports like JupyterFrontEndPlugin are not necessary, or supported in the notebook context.

import '../style/base.css';
Expand All @@ -9,4 +9,3 @@ export * from './version';
export * from './widget';
export * from './rawWidget';
export * from './option';

40 changes: 22 additions & 18 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ const version = require('./package.json').version;
// Custom webpack rules
const rules = [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader']},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
type: "asset/resource",
},
type: 'asset/resource'
}
];

// Packages that shouldn't be bundled but loaded at runtime
const externals = ['@jupyter-widgets/base', '@jupyterlab/application', '@jupyterlab/apputils'];
const externals = [
'@jupyter-widgets/base',
'@jupyterlab/application',
'@jupyterlab/apputils'
];

const resolve = {
extensions: [".ts", ".js"]
extensions: ['.ts', '.js']
};

module.exports = [
Expand All @@ -31,14 +35,14 @@ module.exports = [
filename: 'extension.js',
path: path.resolve(__dirname, 'ipecharts', 'nbextension'),
libraryTarget: 'amd',
publicPath: '',
publicPath: ''
},
module: {
rules: rules
},
devtool: 'source-map',
externals,
resolve,
resolve
},
/**
* Embeddable ipecharts bundle
Expand All @@ -53,19 +57,19 @@ module.exports = [
{
entry: './src/notebook.ts',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'ipecharts', 'nbextension'),
libraryTarget: 'amd',
// Since the library isn't published to unpkg yet, we can't use these
// Uncomment when publishing is set up, and everything should continue working
// library: "ipecharts",
// publicPath: 'https://unpkg.com/ipecharts@' + version + '/dist/'
filename: 'index.js',
path: path.resolve(__dirname, 'ipecharts', 'nbextension'),
libraryTarget: 'amd'
// Since the library isn't published to unpkg yet, we can't use these
// Uncomment when publishing is set up, and everything should continue working
// library: "ipecharts",
// publicPath: 'https://unpkg.com/ipecharts@' + version + '/dist/'
},
devtool: 'source-map',
module: {
rules: rules
rules: rules
},
externals,
resolve,
},
];
resolve
}
];

0 comments on commit d0f356f

Please sign in to comment.