<commit_before>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

var version = require('./package.json').version;

var postcss = require('postcss');

var postcssHandler = () => {
    return [
        postcss.plugin('delete-tilde', () => {
            return function (css) {
                css.walkAtRules('import', (rule) => {
                    rule.params = rule.params.replace('~', '');
                });
            };
        }),
        postcss.plugin('prepend', () => {
            return (css) => {
                css.prepend(`@import '@jupyter-widgets/controls/css/labvariables.css';`)
            }
        }),
        require('postcss-import')(),
        require('postcss-cssnext')()
    ];
}

var loaders = [
            { test: /\.css$/, loader: "style-loader!css-loader!postcss-loader" },
            { test: /\.json$/, loader: "json-loader" },
            // jquery-ui loads some images
            { test: /\.(jpg|png|gif)$/, loader: "file" },
            // required to load font-awesome
            { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
            { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
            { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
            { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
            { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }
        ]

module.exports = [
{// shim
    entry: './lib/embed-webpack.js',
    output: {
        filename : 'embed.js',
        path: './dist',
        publicPath: 'https://unpkg.com/@jupyter-widgets/htmlmanager@' + version + '/dist/',
        //libraryTarget: 'umd'
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler,
    //externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls']
},
{// html manager
    entry: './lib/index.js',
    output: {
        library: '@jupyter-widgets/html-manager',
        filename : 'index.js',
        path: './dist',
        publicPath: 'https://unpkg.com/@jupyter-widgets/htmlmanager@' + version + '/dist/',
        libraryTarget: 'amd',
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler,
    externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls']
},
{// @jupyter-widgets/base
    entry: '@jupyter-widgets/base/lib/index',
    output: {
        library: '@jupyter-widgets/base',
        filename : 'base.js',
        path: './dist',
        publicPath: 'https://unpkg.com/@jupyter-widgets/htmlmanager@' + version + '/dist/',
        libraryTarget: 'amd',
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler
},
{// @jupyter-widgets/controls
    entry: '@jupyter-widgets/controls/lib/index',
    output: {
        library: '@jupyter-widgets/controls',
        filename : 'controls.js',
        path: './dist',
        publicPath: 'https://unpkg.com/@jupyter-widgets/htmlmanager@' + version + '/dist/',
        libraryTarget: 'amd'
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler,
    externals: ['@jupyter-widgets/base']
}
];<commit_msg>Clean up webpack config.<commit_after>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

let version = require('./package.json').version;

let postcss = require('postcss');

let postcssHandler = () => {
    return [
        postcss.plugin('delete-tilde', () => {
            return function (css) {
                css.walkAtRules('import', (rule) => {
                    rule.params = rule.params.replace('~', '');
                });
            };
        }),
        postcss.plugin('prepend', () => {
            return (css) => {
                css.prepend(`@import '@jupyter-widgets/controls/css/labvariables.css';`)
            }
        }),
        require('postcss-import')(),
        require('postcss-cssnext')()
    ];
}

let loaders = [
            { test: /\.css$/, loader: "style-loader!css-loader!postcss-loader" },
            { test: /\.json$/, loader: "json-loader" },
            // jquery-ui loads some images
            { test: /\.(jpg|png|gif)$/, loader: "file" },
            // required to load font-awesome
            { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
            { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
            { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
            { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
            { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" }
        ]

let publicPath = 'https://unpkg.com/@jupyter-widgets/htmlmanager@' + version + '/dist/';

module.exports = [
{// shim
    entry: './lib/embed-webpack.js',
    output: {
        filename : 'embed.js',
        path: './dist',
        publicPath: publicPath,
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler,
},
{// @jupyter-widgets/html-manager
    entry: './lib/index.js',
    output: {
        library: '@jupyter-widgets/html-manager',
        filename : 'index.js',
        path: './dist',
        publicPath: publicPath,
        libraryTarget: 'amd',
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler,
    externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls']
},
{// @jupyter-widgets/base
    entry: '@jupyter-widgets/base/lib/index',
    output: {
        library: '@jupyter-widgets/base',
        filename : 'base.js',
        path: './dist',
        publicPath: publicPath,
        libraryTarget: 'amd',
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler
},
{// @jupyter-widgets/controls
    entry: '@jupyter-widgets/controls/lib/index',
    output: {
        library: '@jupyter-widgets/controls',
        filename : 'controls.js',
        path: './dist',
        publicPath: publicPath,
        libraryTarget: 'amd'
    },
    devtool: 'source-map',
    module: { loaders: loaders },
    postcss: postcssHandler,
    externals: ['@jupyter-widgets/base']
}
];
{'fraction_non_alphanumeric': 0.20074291905277822, 'fraction_numerical': 0.0065005417118093175, 'mean_word_length': 2.1629955947136565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7645663', 'n_tokens_mistral': 2239, 'n_tokens_neox': 2142, 'n_words': 356}