mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 11:19:16 +00:00
Remove trial code, restore repository. Should not have committed this. Oh well. Let's continue this in a branch like I'm supposed to.
This commit is contained in:
96
webpack.mix.js
vendored
96
webpack.mix.js
vendored
@@ -1,88 +1,14 @@
|
||||
let mix = require('laravel-mix');
|
||||
// mix.autoload({
|
||||
// jquery: ['$', 'window.jQuery']
|
||||
// });
|
||||
|
||||
//mix.extract(['jquery','chart.js','accounting','chartjs-color-string','chartjs-color','moment','color-name'],'public/v1/js/ff/vendor.js');
|
||||
mix.extract([],'public/v1/js/ff/vendor.js');
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mix Asset Management
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Mix provides a clean, fluent API for defining some Webpack build steps
|
||||
| for your Laravel application. By default, we are compiling the Sass
|
||||
| file for the application as well as bundling up all the JS files.
|
||||
|
|
||||
*/
|
||||
|
||||
mix.extend(
|
||||
'firefly_iii',
|
||||
new class {
|
||||
constructor() {
|
||||
this.toCompile = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* The API name for the component.
|
||||
*/
|
||||
name() {
|
||||
return 'firefly_iii';
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the component.
|
||||
*
|
||||
* @param {*} entry
|
||||
* @param {string} output
|
||||
*/
|
||||
register(entry, output) {
|
||||
|
||||
entry = [].concat(entry).map(file => new File(file));
|
||||
output = new File(output);
|
||||
|
||||
this.toCompile.push({ entry, output });
|
||||
|
||||
Mix.bundlingJavaScript = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assets to append to the webpack entry.
|
||||
*
|
||||
* @param {Entry} entry
|
||||
*/
|
||||
webpackEntry(entry) {
|
||||
this.toCompile.forEach(js => {
|
||||
entry.addFromOutput(
|
||||
js.entry.map(file => file.path()),
|
||||
js.output,
|
||||
js.entry[0]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
dependencies() {
|
||||
return ["@babel/preset-flow",'@babel/preset-react'];
|
||||
}
|
||||
|
||||
/**
|
||||
* webpack rules to be appended to the master config.
|
||||
*/
|
||||
webpackRules() {
|
||||
return [].concat([
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: this.babelConfig()
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Babel config to be merged with Mix's defaults.
|
||||
*/
|
||||
babelConfig() {
|
||||
return {
|
||||
presets: ["@babel/preset-flow",'@babel/preset-react'],
|
||||
plugins: [["@babel/plugin-proposal-class-properties"]]
|
||||
};
|
||||
}
|
||||
}()
|
||||
);
|
||||
mix.firefly_iii('resources/js/v1/index.js', 'public/v1/js/ff/index.js');
|
||||
mix.js('resources/assets/js/app.js', 'public/v1/js');
|
||||
|
Reference in New Issue
Block a user