Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove v1 -> v2-specific transformations #405

Merged
merged 1 commit into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 33 additions & 35 deletions lib/migrate/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ module.exports = {
filename: 'index.js'
},
module: {
loaders: [{
rules: [{
test: /.js$/,
loaders: ['babel'],
use: [{
loader: 'babel-loader'
}],
include: path.join(__dirname, 'src')
}]
},
resolve: {
root: path.resolve('/src'),
modules: ['node_modules']
},
modules: ['node_modules', path.resolve('/src')]
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true
]
};
1`] = `
"
Expand All @@ -39,21 +39,21 @@ module.exports = {
filename: 'index.js'
},
module: {
loaders: [{
rules: [{
test: /.js$/,
loaders: ['babel'],
use: [{
loader: 'babel-loader'
}],
include: path.join(__dirname, 'src')
}]
},
resolve: {
root: path.resolve('/src'),
modules: ['node_modules']
},
modules: ['node_modules', path.resolve('/src')]
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true
]
};
"
`;
Expand All @@ -73,17 +73,14 @@ module.exports = {
rules: [{
test: /.js$/,
use: [{
loader: \\"babel-loader\\",
loader: 'babel-loader'
}],
include: path.join(__dirname, 'src')
}]
},
resolve: {
modules: ['node_modules', path.resolve('/src')],
modules: ['node_modules', path.resolve('/src')]
},
plugins: [new webpack.LoaderOptionsPlugin({
debug: true,
})],
optimization: {
minimize: true,
}
Expand All @@ -94,15 +91,18 @@ module.exports = {
exports[`transform should transform only using specified transformations 1`] = `
"
module.exports = {
devtool: 'eval',
entry: [
devtool: 'eval',

entry: [
'./src/index'
],
output: {

output: {
path: path.join(__dirname, 'dist'),
filename: 'index.js'
},
module: {

module: {
rules: [{
test: /.js$/,
use: [{
Expand All @@ -111,15 +111,16 @@ module.exports = {
include: path.join(__dirname, 'src')
}]
},
resolve: {
root: path.resolve('/src'),
modules: ['node_modules']
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true

resolve: {
modules: ['node_modules', path.resolve('/src')]
},

plugins: [new webpack.optimize.OccurrenceOrderPlugin()],

optimization: {
minimize: true
}
};
"
`;
Expand Down Expand Up @@ -147,9 +148,6 @@ module.exports = {
resolve: {
modules: ['node_modules', path.resolve('/src')]
},
plugins: [new webpack.LoaderOptionsPlugin({
debug: true
})],
optimization: {
minimize: true
}
Expand Down
6 changes: 0 additions & 6 deletions lib/migrate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@ const jscodeshift = require("jscodeshift");
const pEachSeries = require("p-each-series");
const PLazy = require("p-lazy");

const loadersTransform = require("./loaders/loaders");
const resolveTransform = require("./resolve/resolve");
const removeJsonLoaderTransform = require("./removeJsonLoader/removeJsonLoader");
const uglifyJsPluginTransform = require("./uglifyJsPlugin/uglifyJsPlugin");
const loaderOptionsPluginTransform = require("./loaderOptionsPlugin/loaderOptionsPlugin");
const bannerPluginTransform = require("./bannerPlugin/bannerPlugin");
const extractTextPluginTransform = require("./extractTextPlugin/extractTextPlugin");
const noEmitOnErrorsPluginTransform = require("./noEmitOnErrorsPlugin/noEmitOnErrorsPlugin");
const removeDeprecatedPluginsTransform = require("./removeDeprecatedPlugins/removeDeprecatedPlugins");

const transformsObject = {
loadersTransform,
resolveTransform,
removeJsonLoaderTransform,
uglifyJsPluginTransform,
loaderOptionsPluginTransform,
bannerPluginTransform,
extractTextPluginTransform,
noEmitOnErrorsPluginTransform,
Expand Down
16 changes: 8 additions & 8 deletions lib/migrate/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ module.exports = {
filename: 'index.js'
},
module: {
loaders: [{
rules: [{
test: /.js$/,
loaders: ['babel'],
use: [{
loader: 'babel-loader'
}],
include: path.join(__dirname, 'src')
}]
},
resolve: {
root: path.resolve('/src'),
modules: ['node_modules']
},
modules: ['node_modules', path.resolve('/src')]
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true
]
};
`;

Expand All @@ -48,7 +48,7 @@ describe("transform", () => {
});

it("should transform only using specified transformations", done => {
transform(input, [transformations.loadersTransform]).then(output => {
transform(input, [transformations.uglifyJsPluginTransform]).then(output => {
expect(output).toMatchSnapshot();
done();
});
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

48 changes: 0 additions & 48 deletions lib/migrate/loaderOptionsPlugin/loaderOptionsPlugin.js

This file was deleted.

8 changes: 0 additions & 8 deletions lib/migrate/loaderOptionsPlugin/loaderOptionsPlugin.test.js

This file was deleted.

Loading