Skip to content

Commit e408671

Browse files
authored
Merge pull request #18 from QuantStack/webpackConfig
Add webpack config for `blockly`
2 parents 7f33f2c + dc76031 commit e408671

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
},
8989
"jupyterlab": {
9090
"extension": true,
91-
"outputDir": "jupyterlab_niryo_one/labextension"
91+
"outputDir": "jupyterlab_niryo_one/labextension",
92+
"webpackConfig": "./webpack.config.js"
9293
}
9394
}

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ source = "nodejs"
4444
fields = ["description", "authors", "urls"]
4545

4646
[tool.hatch.build.targets.sdist]
47-
artifacts = ["/jupyterlab_niryo_one/labextension"]
48-
exclude = ["/.github", "/binder", "node_modules"]
47+
artifacts = ["jupyterlab_niryo_one/labextension"]
48+
exclude = [".github", "binder", "node_modules"]
4949

5050
[tool.hatch.build.targets.wheel.shared-data]
5151
"jupyterlab_niryo_one/labextension" = "share/jupyter/labextensions/jupyterlab-niryo-one"

webpack.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// @ts-check
2+
3+
module.exports = /** @type { import('webpack').Configuration } */ ({
4+
devtool: 'source-map',
5+
module: {
6+
rules: [
7+
// Load Blockly source maps.
8+
{
9+
test: /(blockly\/.*\.js)$/,
10+
use: [require.resolve('source-map-loader')],
11+
enforce: 'pre'
12+
}
13+
].filter(Boolean)
14+
},
15+
// https://github.com/google/blockly-samples/blob/9974e85becaa8ad17e35b588b95391c85865dafd/plugins/dev-scripts/config/webpack.config.js#L118-L120
16+
ignoreWarnings: [/Failed to parse source map/]
17+
});
18+

0 commit comments

Comments
 (0)