2019-08-21 04:57:57 +00:00
|
|
|
const { environment } = require('@rails/webpacker');
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader');
|
|
|
|
const resolve = require('./resolve');
|
|
|
|
const vue = require('./loaders/vue');
|
2019-08-17 19:14:44 +00:00
|
|
|
|
2019-08-21 04:57:57 +00:00
|
|
|
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin());
|
|
|
|
environment.loaders.prepend('vue', vue);
|
2022-05-02 07:44:04 +00:00
|
|
|
|
2022-12-22 08:06:03 +00:00
|
|
|
environment.loaders.append('opus-ogg', {
|
2022-05-02 07:44:04 +00:00
|
|
|
test: /encoderWorker\.min\.js$/,
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: '[name].[ext]',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-12-22 08:06:03 +00:00
|
|
|
environment.loaders.append('opus-wav', {
|
|
|
|
test: /waveWorker\.min\.js$/,
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: '[name].[ext]',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-08-14 09:48:44 +00:00
|
|
|
environment.loaders.append('audio', {
|
|
|
|
test: /\.(mp3)(\?.*)?$/,
|
|
|
|
loader: 'url-loader',
|
|
|
|
query: {
|
|
|
|
limit: 10000,
|
2019-08-21 04:57:57 +00:00
|
|
|
name: 'audio/[name].[ext]',
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
2019-08-21 04:57:57 +00:00
|
|
|
});
|
2019-08-14 09:48:44 +00:00
|
|
|
|
|
|
|
environment.config.merge({ resolve });
|
2019-10-29 07:20:54 +00:00
|
|
|
environment.config.set('output.filename', chunkData => {
|
|
|
|
return chunkData.chunk.name === 'sdk'
|
|
|
|
? 'js/[name].js'
|
|
|
|
: 'js/[name]-[hash].js';
|
|
|
|
});
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2019-08-21 04:57:57 +00:00
|
|
|
module.exports = environment;
|