Registry / http-networking / webpack-xlsx-loader

webpack-xlsx-loader

JSON →
library1.0.0jsnpmunverified

Webpack loader that imports and parses .xlsx files into a workbook object compatible with the xlsx npm module. Version 1.0.0 is the initial release with no active development since 2016. It transforms xlsx files into a JSON representation (SheetNames and Sheets) that can be directly consumed by xlsx utility functions. Differentiated by simplicity: just a loader with no extra configuration required. Alternatives include raw xlsx import with file-loader or manual parsing.

npm install webpack-xlsx-loader
INSTALL
IMPORT
SIG · WEBPACK-XLSX-LOADE
W
webpack-xlsx-loader
http-networkingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import spreadsheet from './path/to/file.xlsx'
import { default } from './path/to/file.xlsx'
Default import returns the workbook object. No named export.
xlsx
import xlsx from 'xlsx'
const xlsx = require('xlsx')
xlsx is a peer dependency; must be installed separately. ESM import is recommended.

Configures webpack to load xlsx files, then imports a spreadsheet and converts first sheet to CSV.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.xlsx$/, loader: 'webpack-xlsx-loader' } ] } }; // app.js import spreadsheet from './data.xlsx'; import xlsx from 'xlsx'; console.log(spreadsheet.SheetNames); // ['Sheet1'] console.log(xlsx.utils.sheet_to_csv(spreadsheet.Sheets['Sheet1']));
Debug
Known issues
deprecatedNo updates since 2016; not compatible with webpack 5+ (deprecated loader API).
fix
Use a modern replacement like @softarc/xlsx-loader or raw xlsx with asset modules.
affects: >=1.0.0
gotchaRequires xlsx as a peer dependency; not automatically installed.
fix
Run npm install xlsx separately.
affects: >=1.0.0
breakingWebpack 4 loader API changes: pitch phase may break with extract-text-webpack-plugin.
fix
Use MiniCssExtractPlugin or avoid loaders that intercept pitch.
affects: >=1.0.0
Errors
Common errors & fixes
Module parse failed: Unexpected token (1:0) in file.xlsx
Webpack doesn't have a loader for .xlsx files.
fix
Add webpack-xlsx-loader to webpack config as shown in usage.
Cannot find module 'xlsx'
xlsx is not installed.
fix
Run npm install xlsx.
Spreadsheet import is undefined
The loader output is a JSON object; must be default imported.
fix
Use import spreadsheet from './file.xlsx' not import { SheetNames } from './file.xlsx'.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
24
OpenAI (training)
1
Resources
webpack-xlsx-loader — npm install webpack-xlsx-loader · libregistry