Skip to content

Instantly share code, notes, and snippets.

@MFry
Last active February 16, 2023 16:58
Show Gist options
  • Save MFry/41fd51e8057152b9b914ecd1379a53d2 to your computer and use it in GitHub Desktop.
Save MFry/41fd51e8057152b9b914ecd1379a53d2 to your computer and use it in GitHub Desktop.

Revisions

  1. MFry revised this gist Jan 10, 2017. 1 changed file with 1 addition and 16 deletions.
    17 changes: 1 addition & 16 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,6 @@
    import * as Toastr from 'toastr';
    import './/../node_modules/toastr/build/toastr.css'; //You need style and css loader installed and set

    Toastr.options = {
    closeButton: false,
    newestOnTop: false,
    progressBar: false,
    positionClass: 'toast-bottom-right',
    preventDuplicates: false,
    onclick: null,
    showDuration: 300,
    hideDuration: 1000,
    timeOut: 5000,
    extendedTimeOut: 1000,
    showEasing: 'swing',
    hideEasing: 'linear',
    showMethod: 'fadeIn',
    hideMethod: 'fadeOut',
    };
    Toastr.options.timeout = 2000; //Change the settings

    Toastr.info('This works!');
  2. MFry revised this gist Jan 9, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 2 additions & 0 deletions Webpack and toastr
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    //In case anyone was having the same issue in getting toastr to run with webpack and es6

    2 changes: 0 additions & 2 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    //In case anyone was having the same issue in getting toastr to run with webpack and es6

    import * as Toastr from 'toastr';
    import './/../node_modules/toastr/build/toastr.css'; //You need style and css loader installed and set

  3. MFry revised this gist Jan 9, 2017. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    //In case anyone was having the same issue in getting toastr to run with webpack and es6
    ```javascript

    import * as Toastr from 'toastr';
    import './/../node_modules/toastr/build/toastr.css'; //You need style and css loader installed and set
    @@ -22,5 +21,3 @@ import './/../node_modules/toastr/build/toastr.css'; //You need style and css lo
    };

    Toastr.info('This works!');
    ```
  4. MFry renamed this gist Jan 9, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. MFry revised this gist Jan 9, 2017. 1 changed file with 38 additions and 0 deletions.
    38 changes: 38 additions & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    var webpack = require('webpack');
    var path = require('path');
    var assetsPath = '/assets/javascript';
    var destinationPointPath = '/dist';
    // Why use ProvidePlugin and externals: http://stackoverflow.com/a/30587246/1771644
    module.exports = {

    entry: `${__dirname}` + '/javascript/src/app.js',
    output: {
    path: `${__dirname}`+ '/dist',
    filename: 'co.js'
    },
    resolve :{
    extensions: ["", ".js"]
    },
    externals: {
    "jquery": "jQuery"
    },
    module: {
    loaders: [
    {
    test: /\.css$/, loader: 'style-loader!css-loader'
    },
    {
    test: /\.js$/, loader: 'babel',
    exclude: /(node_modules|bower_components)/,
    query: {
    presets: ['es2015']
    }
    }
    ]
    },
    plugins: [
    new webpack.ProvidePlugin({
    $: "jquery"
    })
    ]
    }
  6. MFry created this gist Jan 9, 2017.
    26 changes: 26 additions & 0 deletions Webpack and toastr
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    //In case anyone was having the same issue in getting toastr to run with webpack and es6
    ```javascript

    import * as Toastr from 'toastr';
    import './/../node_modules/toastr/build/toastr.css'; //You need style and css loader installed and set

    Toastr.options = {
    closeButton: false,
    newestOnTop: false,
    progressBar: false,
    positionClass: 'toast-bottom-right',
    preventDuplicates: false,
    onclick: null,
    showDuration: 300,
    hideDuration: 1000,
    timeOut: 5000,
    extendedTimeOut: 1000,
    showEasing: 'swing',
    hideEasing: 'linear',
    showMethod: 'fadeIn',
    hideMethod: 'fadeOut',
    };

    Toastr.info('This works!');

    ```