New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

inline-template-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inline-template-loader

inline template

0.1.0
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

inline-template-loader

Install

npm install inline-template-loader

Usage

// webpack.conf.js

module: {
  rules:[{
    test: /\.js$/,
    loader: 'inline-template-loader'
  }]
}

Output

// index.js
function foo(){
  return __inline('./template.html');
}
// template.html
<div class="template">
  <h1>HelloWorld</h1>
</div>
// output.js
function foo(){
  return '<div class="template"><h1>HelloWorld</h1></div>';
}

options

// webpack.conf.js

module: {
  rules:[{
    test: /\.js$/,
    loader: 'inline-template-loader',
    options: {
      pattern: /__template(/    // 正则
      replcement: function(m){  // 替换方法
        return m.slice(1);
      }
    }
  }]
}

License

MIT

Keywords

inline

FAQs

Package last updated on 15 May 2017

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