1.0.0 • Published 9 years ago
text-brunch v1.0.0
text-brunch
Brunch plugin to read text files as strings in JS.
Install
npm install -D text-brunchConfiguration
By default will work on any .txt file. If you want more, configure it using pattern.
You can configure where the plugin is used using the pattern configuration option. It takes a regular expression or glob or an array of those.
exports.config = {
plugins: {
text: {
pattern: /^fixtures\//
}
}
}Usage
const myTextString = require('./my-file.txt');If you have JS/TS files with the same base name as your text/other files, and you want to refer to the JS/TS files without their extension, you may want to include this in your config file:
// change the regex to match your pattern if you are using a custom pattern
exports.config = {
files: {
javascripts: {
order: {
after: [/\.txt$/]
}
}
}
}This will force your text files to be output later in the file, which means they won't take the alias for the base name.
1.0.0
9 years ago
1.0.0-beta.1
9 years ago