我正在寻找一种方法来获取所有scss文件和所有背景图片。
这是我当前状态的webpack:
__attribute__((visibility("default")))
我们可以将其设置为引入分发依赖项的文件吗?
以下是我们需要它的示例:
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: ['./src/index.tsx', './src/styles/index.scss'],
output: {
path: __dirname+'/dist',
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
devtool: "source-map",
module: {
rules: [
{
test: /\.(ttf|otf|eot|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file-loader'
},
{
test: /\.(sass|scss)$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract(['css-loader', 'sass-loader'])
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: "babel-loader?presets[]=es2015&presets[]=react!awesome-typescript-loader"
},
{
test: /\.jsx?/,
exclude: /node_modules/,
loader: "babel",
options: {
presets: ["es2015", "react"]
}
}
]
},
plugins: [
new ExtractTextPlugin({
filename: 'bundle.css',
allChunks: true,
})
]
};