Socket
Book a DemoInstallSign in
Socket

move-file-loader

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

move-file-loader

A Webpack loader to move files from one location to another and return the contents.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
10
11.11%
Maintainers
3
Weekly downloads
 
Created
Source

move-file-loader for Webpack

A Webpack loader to move files from one location to another and return the contents.

npm version

This webpack loader allows you to output required or imported files to a specific location, and return the contents of the file. Check out the blog post for more examples.

Install

$ npm i --save move-file-loader

Usage

Add a loader to your Webpack configuration that describes how and where to move the file. The contents of the file are returned from the loader.

module.exports = {
    ...your webpack config,
    module: {
        rules: [{
            test: /.json/,
            /**
             * This will move .json files to the [path]/[name].json
             * location after being processed by json-loader
             */
            use: "move-file-loader?name=[path][name].json!json"
        }]
    },
    ...the rest of your webpack config
}

And import a JSON file:

import stuff from 'file.json'

console.log(stuff); // Contents of the JSON file

License

All of the code snippets in this repository are licensed under MIT. View the license

assertible.com  ·  GitHub @assertible  ·  Twitter @AssertibleApp

FAQs

Package last updated on 12 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.