Download spectrum/backpack.config.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/backpack.config.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/backpack.config.js
-
curl -L -o backpack.config.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/backpack.config.js
1.18 kB
| const path = require('path'); | |
| const debug = require('debug')('build:backpack'); | |
| const dir = process.env.DIR; | |
| if (!dir) throw new Error('Define directory to build with the -d option.'); | |
| debug( | |
| `> Building ${dir}, entry: ${dir}/index.js, output: build-${dir}/main.js` | |
| ); | |
| module.exports = { | |
| webpack: (config, options, webpack) => { | |
| config.entry.main = [`./${dir}/index.js`]; | |
| config.output.path = path.join(process.cwd(), `build-${dir}`); | |
| const nodePath = (process.env.NODE_PATH || '') | |
| .split(path.delimiter) | |
| .filter(folder => folder && !path.isAbsolute(folder)) | |
| .map(folder => path.resolve('./', folder)) | |
| .join(path.delimiter); | |
| if (process.env.NODE_ENV !== 'production' && !process.env.SSR) { | |
| config.plugins.push( | |
| new webpack.WatchIgnorePlugin([ | |
| path.resolve(__dirname, './src'), | |
| path.resolve(__dirname, './build'), | |
| ]) | |
| ); | |
| } | |
| // Tell Sentry which server the errors are coming from | |
| config.plugins.push( | |
| new webpack.DefinePlugin({ | |
| 'process.env.SENTRY_NAME': JSON.stringify(dir), | |
| }) | |
| ); | |
| config.resolve.modules.push(nodePath); | |
| return config; | |
| }, | |
| }; | |