Skip to content

Instantly share code, notes, and snippets.

@ksrb
Last active March 10, 2021 05:58
Show Gist options
  • Select an option

  • Save ksrb/47f9124c2f5be13f39dc645405a12608 to your computer and use it in GitHub Desktop.

Select an option

Save ksrb/47f9124c2f5be13f39dc645405a12608 to your computer and use it in GitHub Desktop.

Revisions

  1. ksrb revised this gist Feb 6, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,7 @@ module.exports = {
    // version
    'jquery': _path('node_modules/jquery/dist/jquery'),
    // Switch dependency lib accordingly (this one uses jquery)
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib.jquery'),
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib'),
    // Core library (order of these aliases shouldn't matter FYI)
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$('selector').inputmask(...)
  2. ksrb revised this gist Nov 29, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,7 @@
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "babel-core": "^6.0.0",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-stage-0": "^6.5.0",
  3. ksrb revised this gist Aug 23, 2016. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    import 'jquery.inputmask';
    // Add extensions as necessary make sure you remember to add the corresponding aliases in the webpack config
    import 'inputmask.numeric.extension';
    import 'inputmask.numeric.extensions';
    import $ from 'jquery';

    $(() => {
    2 changes: 1 addition & 1 deletion webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -57,7 +57,7 @@ module.exports = {
    // Allows use of jquery input mask via jquery chaining api/$('selector').inputmask(...)
    'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'),
    // Add extensions following the pattern below remember to import them as necessary in your .js files
    'inputmask.numeric.extension': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.numeric.extensions'),
    'inputmask.numeric.extensions': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.numeric.extensions'),
    },
    },
    plugins: [
  4. ksrb revised this gist Aug 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    import 'jquery.inputmask';
    import 'inputmask.numeric.extension';
    // Add extensions as necessary make sure you remember to add the corresponding aliases in the webpack config
    import 'inputmask.numeric.extension';
    import $ from 'jquery';

    $(() => {
  5. ksrb revised this gist Aug 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    import 'jquery.inputmask';
    import 'inputmask.numeric.extension';
    // Add extensions as necessary make sure you remember to add the corresponding the aliases in the webpack config
    // Add extensions as necessary make sure you remember to add the corresponding aliases in the webpack config
    import $ from 'jquery';

    $(() => {
  6. ksrb revised this gist Aug 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ module.exports = {
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$('selector').inputmask(...)
    'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'),
    // Add extensions following the pattern below
    // Add extensions following the pattern below remember to import them as necessary in your .js files
    'inputmask.numeric.extension': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.numeric.extensions'),
    },
    },
  7. ksrb revised this gist Aug 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    import 'jquery.inputmask';
    import 'inputmask.numeric.extension';
    // Add extensions as necessary make sure you remember to update the aliases in the webpack config
    // Add extensions as necessary make sure you remember to add the corresponding the aliases in the webpack config
    import $ from 'jquery';

    $(() => {
  8. ksrb revised this gist Aug 23, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    import 'jquery.inputmask';
    import 'inputmask.numeric.extension';
    // Add extensions as necessary make sure you remember to update the aliases in the webpack config
    import $ from 'jquery';

    $(() => {
  9. ksrb revised this gist Aug 23, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    import 'jquery.inputmask';
    import 'inputmask.numeric.extension';
    import $ from 'jquery';

    $(() => {
  10. ksrb revised this gist Jun 29, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -54,7 +54,7 @@ module.exports = {
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib.jquery'),
    // Core library (order of these aliases shouldn't matter FYI)
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$.inputmask
    // Allows use of jquery input mask via jquery chaining api/$('selector').inputmask(...)
    'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'),
    // Add extensions following the pattern below
    'inputmask.numeric.extension': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.numeric.extensions'),
  11. ksrb revised this gist Jun 29, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ module.exports = {
    // jquery is NOT a peer dependency in jquery.inputmask so a alias
    // is used here to force jquery.inputmask to use your jquery
    // version
    'jquery': _path('./node_modules/jquery/dist/jquery'),
    'jquery': _path('node_modules/jquery/dist/jquery'),
    // Switch dependency lib accordingly (this one uses jquery)
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib.jquery'),
    // Core library (order of these aliases shouldn't matter FYI)
  12. ksrb revised this gist Jun 28, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,7 @@ module.exports = {
    'jquery': _path('./node_modules/jquery/dist/jquery'),
    // Switch dependency lib accordingly (this one uses jquery)
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib.jquery'),
    // Core library (order of these aliases shouldn't matter FYI)
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$.inputmask
    'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'),
  13. ksrb revised this gist Jun 28, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,7 @@ module.exports = {
    // is used here to force jquery.inputmask to use your jquery
    // version
    'jquery': _path('./node_modules/jquery/dist/jquery'),
    // Switch dependency lib accordingly (this one uses jquery)
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib.jquery'),
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$.inputmask
  14. ksrb revised this gist Jun 28, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -54,6 +54,8 @@ module.exports = {
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$.inputmask
    'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'),
    // Add extensions following the pattern below
    'inputmask.numeric.extension': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.numeric.extensions'),
    },
    },
    plugins: [
  15. ksrb revised this gist Jun 28, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion index.js
    Original file line number Diff line number Diff line change
    @@ -2,5 +2,5 @@ import 'jquery.inputmask';
    import $ from 'jquery';

    $(() => {
    $(document.getElementById('float')).inputmask('99-99999');
    $('#float').inputmask('99-99999');
    });
  16. ksrb revised this gist Jun 28, 2016. 2 changed files with 0 additions and 4 deletions.
    1 change: 0 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,6 @@
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "babel-eslint": "^6.1.0",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-stage-0": "^6.5.0",
    3 changes: 0 additions & 3 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,4 @@
    /* eslint-disable */
    'use strict';
    /* eslint-enable */


    let webpack = require('webpack');
    let HTMLWebpackPlugin = require('html-webpack-plugin');
  17. ksrb revised this gist Jun 28, 2016. 2 changed files with 0 additions and 12 deletions.
    3 changes: 0 additions & 3 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -17,9 +17,6 @@
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-stage-0": "^6.5.0",
    "css-loader": "^0.23.1",
    "eslint": "^2.13.1",
    "eslint-loader": "^1.3.0",
    "eslint-plugin-babel": "^3.3.0",
    "html-webpack-plugin": "^2.21.0",
    "postcss": "^5.0.21",
    "postcss-cssnext": "^2.6.0",
    9 changes: 0 additions & 9 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -26,11 +26,6 @@ module.exports = {
    test: /\.js$/,
    loader:'source-map',
    },
    {
    test: /\.js$/,
    loader:'eslint',
    exclude: /(node_modules)/,
    },
    ],
    loaders: [
    {
    @@ -78,10 +73,6 @@ module.exports = {
    chunks: 'app',
    }),
    ],
    eslint: {
    configFile: './.eslintrc',
    emitError: true,
    },
    bail: true,
    debug: true,
    devServer: {
  18. ksrb revised this gist Jun 28, 2016. 3 changed files with 17 additions and 2 deletions.
    10 changes: 10 additions & 0 deletions index.ejs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title><%= htmlWebpackPlugin.options.title %></title>
    </head>
    <body>
    <input id="float"/>
    </body>
    </html>
    6 changes: 6 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import 'jquery.inputmask';
    import $ from 'jquery';

    $(() => {
    $(document.getElementById('float')).inputmask('99-99999');
    });
    3 changes: 1 addition & 2 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    /* eslint-disable */
    /* eslint-disable */
    'use strict';
    /* eslint-enable */

    @@ -13,7 +13,6 @@ function _path(p) {
    }

    module.exports = {
    context: _path('src'),
    entry: {
    app: './index.js',
    },
  19. ksrb created this gist Jun 28, 2016.
    36 changes: 36 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    {
    "name": "input-mask",
    "version": "1.0.0",
    "description": "Testing jquery.inputmask options",
    "repository": "input-mask",
    "main": "src/index.js",
    "scripts": {
    "start": "webpack-dev-server",
    "build": "webpack -p",
    "test": "echo \"Error: no test specified\" && exit 1"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "babel-eslint": "^6.1.0",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-stage-0": "^6.5.0",
    "css-loader": "^0.23.1",
    "eslint": "^2.13.1",
    "eslint-loader": "^1.3.0",
    "eslint-plugin-babel": "^3.3.0",
    "html-webpack-plugin": "^2.21.0",
    "postcss": "^5.0.21",
    "postcss-cssnext": "^2.6.0",
    "postcss-loader": "^0.9.1",
    "source-map-loader": "^0.1.5",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.1",
    "webpack-dev-server": "^1.14.1"
    },
    "dependencies": {
    "jquery": "^3.0.0",
    "jquery.inputmask": "^3.3.1"
    }
    }
    98 changes: 98 additions & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,98 @@
    /* eslint-disable */
    'use strict';
    /* eslint-enable */


    let webpack = require('webpack');
    let HTMLWebpackPlugin = require('html-webpack-plugin');
    let postcss_cssnext = require('postcss-cssnext');
    let path = require('path');

    function _path(p) {
    return path.join(__dirname, p);
    }

    module.exports = {
    context: _path('src'),
    entry: {
    app: './index.js',
    },

    output: {
    filename: '[name].js',
    },
    module: {
    preLoaders: [
    {
    test: /\.js$/,
    loader:'source-map',
    },
    {
    test: /\.js$/,
    loader:'eslint',
    exclude: /(node_modules)/,
    },
    ],
    loaders: [
    {
    test: /\.js$/,
    loader: 'babel',
    exclude: /(node_modules)/,
    query: {
    presets: [
    'es2015',
    'stage-0',
    ],
    passPerPreset: true,
    },
    },
    {
    test: /\.css$/,
    loader: 'style!css?importLoaders=1!postcss',
    },
    ],
    },
    postcss: [postcss_cssnext],
    resolve: {
    alias: {
    // jquery is NOT a peer dependency in jquery.inputmask so a alias
    // is used here to force jquery.inputmask to use your jquery
    // version
    'jquery': _path('./node_modules/jquery/dist/jquery'),
    'inputmask.dependencyLib': _path('node_modules/jquery.inputmask/dist/inputmask/inputmask.dependencyLib.jquery'),
    'inputmask' : _path('node_modules/jquery.inputmask/dist/inputmask/inputmask'),
    // Allows use of jquery input mask via jquery chaining api/$.inputmask
    'jquery.inputmask': _path('node_modules/jquery.inputmask/dist/inputmask/jquery.inputmask'),
    },
    },
    plugins: [
    new webpack.SourceMapDevToolPlugin(
    '[file].map', null,
    '[absolute-resource-path]',
    '[absolute-resource-path]'
    ),
    new HTMLWebpackPlugin({
    title: 'Inputmask',
    template: 'index.ejs',
    filename: 'index.html',
    inject: 'head',
    chunks: 'app',
    }),
    ],
    eslint: {
    configFile: './.eslintrc',
    emitError: true,
    },
    bail: true,
    debug: true,
    devServer: {
    publicPath: '/',
    outputPath: _path('build'),
    stats: {colors: true},
    host: '0.0.0.0',
    inline: true,
    port: '8090',
    quiet: false,
    noInfo: false,
    },
    };