raw-loader-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@emp/cli

// emp-config.ts

import { empRawPlugin } from 'raw-loader-plugin';

export default {
    // ...其他配置信息...
    plugins: [
        empRawPlugin(),
    ],
};

webpack

  • 第一张方法
// webpack.config.js
import { webpackRawPlugin } from 'raw-loader-plugin';

export default {
    // ...其他配置信息...
    plugins: [
       new webpackRawPlugin(),
    ],
};
  • 第二种方法
// webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.svg$/i,
        type: 'asset/source',
        resourceQuery: /\?raw/,
        use: [
          {
            loader: require.resolve('raw-loader-plugin/dist/raw-loader.js'),
            options: {
              mode: 'raw',
            },
          },
        ],
      },
    ],
  },
};
declare const rawLoaderOptions: {
    mode?: 'es' | 'common' | 'raw' | 'base64';
    test?: RegExp;
    resourceQuery?: RegExp;
};
empRawPlugin(options?: rawLoaderOptions);

Readme

Keywords

Package Sidebar

Install

npm i raw-loader-plugin

Weekly Downloads

0

Version

0.1.0

License

ISC

Unpacked Size

4.52 kB

Total Files

6

Last publish

Collaborators

  • meji