Selaa lähdekoodia

Add more loaders to the webpack config (#3743)

* Add loading of text .txt files to webpack.

* Add an escape hatch to use the webpack raw, url, and file loaders.

This allows a user to rename their file with a prefix, such as JUPYTERLAB_RAW_LOADER_filename.xml, to get a specific webpack loader to be used.
Jason Grout 7 vuotta sitten
vanhempi
commit
57fa5eff03
2 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 4 0
      dev_mode/webpack.config.js
  2. 4 0
      jupyterlab/staging/webpack.config.js

+ 4 - 0
dev_mode/webpack.config.js

@@ -113,9 +113,13 @@ module.exports = {
   },
   module: {
     rules: [
+      { test: /^JUPYTERLAB_RAW_LOADER_/, use: 'raw-loader' },
+      { test: /^JUPYTERLAB_URL_LOADER_/, use: 'url-loader?limit=10000' },
+      { test: /^JUPYTERLAB_FILE_LOADER_/, use: 'file-loader' },
       { test: /\.css$/, use: ['style-loader', 'css-loader'] },
       { test: /\.json$/, use: 'json-loader' },
       { test: /\.md$/, use: 'raw-loader' },
+      { test: /\.txt$/, use: 'raw-loader' },
       { test: /\.js$/, use: ['source-map-loader'], enforce: 'pre',
         // eslint-disable-next-line no-undef
         exclude: path.join(process.cwd(), 'node_modules')

+ 4 - 0
jupyterlab/staging/webpack.config.js

@@ -113,9 +113,13 @@ module.exports = {
   },
   module: {
     rules: [
+      { test: /^JUPYTERLAB_RAW_LOADER_/, use: 'raw-loader' },
+      { test: /^JUPYTERLAB_URL_LOADER_/, use: 'url-loader?limit=10000' },
+      { test: /^JUPYTERLAB_FILE_LOADER_/, use: 'file-loader' },
       { test: /\.css$/, use: ['style-loader', 'css-loader'] },
       { test: /\.json$/, use: 'json-loader' },
       { test: /\.md$/, use: 'raw-loader' },
+      { test: /\.txt$/, use: 'raw-loader' },
       { test: /\.js$/, use: ['source-map-loader'], enforce: 'pre',
         // eslint-disable-next-line no-undef
         exclude: path.join(process.cwd(), 'node_modules')