zswang / fis3-parser-webpack

A parser plugin for fis3 to compile webpack file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fis3-parser-webpack

A parser for fis to compile webpack module.

NPM version Build Status Coverage Status

使用示例

fis.match('xx.js', {
    parser: fis.plugin('webpack', {
        module: {
            rules: [{
                test: /\.css$/,
                use: [ 'style-loader', 'css-loader' ]
            }]
        },
        // ...options
        // 请参考 https://webpack.js.org/configuration/#options
    })
})

或者

fis.match('xx.js', {
    parser: fis.plugin('webpack', {
        getOptions: function(webpack) {
            return {
                module: {
                    rules: [{
                        test: /\.css$/,
                        use: [ 'style-loader', 'css-loader' ]
                    }]
                },
                plugins: [
                    // Ignore require() calls in vs/language/typescript/lib/typescriptServices.js
                    new webpack.IgnorePlugin(
                        /^((fs)|(path)|(os)|(crypto)|(source-map-support))$/,
                        /vs\/language\/typescript\/lib/
                    )
                ]
            }
        }
    })
})

License

MIT © zswang

About

A parser plugin for fis3 to compile webpack file.

License:MIT License


Languages

Language:JavaScript 98.7%Language:HTML 0.7%Language:TypeScript 0.6%