js-yaml-loaderのインストール
npm install js-yaml-loader
next.config.js に以下を設定
module.exports = {
webpack: function (config) {
config.module.rules.push(
{
test: /\.ya?ml$/,
use: 'js-yaml-loader',
},
)
return config
}
}
使用する
import useryml from 'user.yml';
console.log( '● useryml' );
console.log( useryml );